LordMrT
4th October 2021, 16:05
Hello all,

I found an old session for file handling in Infor LN 10.7. Now I wanted to check this and copy it to the current VRC. During compilation the following error occurs:

pneadm99900( 440): Error: Unresolved reference to function 'select.file'.
function domain tcmcs.str256m get.server.file()
{
domain tgfile my.path
long i, j
string selected(256,2)
long no.of.selected
long max.selected

my.path = getcwd()
| my.path = "" |* for default of $HOME path take this
no.of.selected = 1

select.file( my.path,
0,
selected,
no.of.selected,
1)
return(selected(1,1))
}

Was there a change in the function here? I had not found anything on the first try.

Thanks a lot :-)

mark_h
4th October 2021, 17:11
If it was 4c4 I would be checking to make sure any includes or libraries attached to the script also copied into the new VRC first. I am not sure if that is an LN library or not.

andreas.toepper
5th October 2021, 10:08
I think it may be explained here:
http://www.baanboard.com/baanboard/showpost.php?p=7971&postcount=6

But I think I would check the available FileManager functions in LN instead and change the code.

Syntax:
function long FileManager.selectFile ( [string i.root.path], string i.start.path, string i.mime.filter, ref string o.file)

Description

This shows the File Manager workbench running in file selection mode to allow a user to select a file on the server.


Arguments
[string i.root.path] when specified, the root directory for the File Manager workbench. A user can navigate to child directories but not to the parent of the root directory. Also, the start directory, i.start.path, must be located within the root directory otherwise the error message "Directory X is not a directory within Y" where X is the i.start.path and Y is the i.root.path.

string i.start.path The startup directory for the File Manager workbench. If i.start.path specifies a file instead of a directory, the directory part of i.start.path is used as startup directory. Note that if i.root.path is not specified or is empty, this startup directory becomes the root directory of the File Manager workbench. In case of an empty string the startup directory will be the directory where the Baan Software Environment is installed (see bse.dir$).

string i.mime.filter The list of mime types, separated by commas, of the files shown by the File Manager. If the list is an empty string all files are shown.

ref string o.file Output argument which will contain the full path of the file selected by the user.


Return values
1 The user has selected a file.
0 The user has cancelled.
-1 Error occurred

Context
This function is implemented in the 4GL Tools and can be used in all script types. This function is available from TIV level 2200.