PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > SELECTFILE command
SELECTFILE command

Opens a dialog box for selecting a file.

The full path of the selected file is returned in the &RESULT variable.

If the user cancels the selection, the *CANCEL value is retrieved. 

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('SELECTFILE')

CHGVAR

VAR(&PARM1) VALUE('
[Pattern=
Files to look for";]
[File="
File name to look for";]
[Title="
Window title";]
[Directory="
Initial directory";]
[PathMustExist;]
[FileMustExist;]
[CreatePrompt;]
[OverWritePrompt;]
[NameOnly;]
[DftExt="
Default file extension";]
[Save;]
[Folders;]
[Copy;]
')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

Pattern gives the list of files categories that can be selected.
Each category is represented by a description text, followed by the character "=", then followed by the filters strings.
The filter strings are separated from each other by a semi column.
A double semi column separates the categories from each other.

Example :
Pattern=”Text files=*.doc ;*.dot ;*.txt ;;All files=
*.*"

By default, LAUNCHER Office selects for Word files.

 

File sets the initial file name to select.

 

Title changes the Window title.

 

Directory sets the initial directory.

 

PathMustExist : If set, the path to the selected file must exist.

 

FileMustExist : If set, the selected file must exist.

 

CreatePrompt : If the file does not exist , Windows will ask the user to confirm the file creation.

 

OverWritePrompt : If the file already exists, Windows will ask for the file replacement.

 

NameOnly to receive only the file name, without its full directory path.

 

DftExt sets the default extension that will be append to the file name if the user does not give one.

 

Save : This options will open the Windows dialog box to browse for a file to write.

 

Folders : To parse only the directories, set this option.

 

Copy will make LAUNCHER copy the selected path and file name to the clipboard. The User will be able to paste it in another application.

 

Note

When you enter a LAUNCHER Office CL command, like LNCPRTDOC, by pressing F4 on a parameter containing a "File Path", the SELECTFILE command is called. The option Copy is set. This allows you to paste the path from your terminal emulation.

 

Example

 

CHGVAR

VAR(&CMD) VALUE('SELECTFILE')

CHGVAR

VAR(&PARM1) VALUE(' +
Pattern=”Text file=*.doc;*.dot;*.txt;;Excel files=*.xls;;All files=*.*”; +
Directory=”C:\My Documents”;FileMustExist')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +
&PARM2 &RESULT)

 

See also

 

CHKFILE

LNCPRTDOC - CL Command