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

Opens a text type file on a PC.

If the file does not exist it will be created.

 

Syntax

CHGVAR

VAR(&CMD) VALUE('FILEOPEN')

CHGVAR

VAR(&PARM1) VALUE('File="name de File" [;UNICODE] [ ;Truncate] [ ;InsertNL]')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

File : Complete path of the file.

UNICODE : True / False (False= Default)
Set
"UNICODE=True" to generate an UNICODE format file (16 Bits characters).

Truncate : True / False (False= Default)

If Truncate is true, the file is deleted.

InsertNL : True / False (False= Default)

If InsertNL is true, each writing in the file using FILEWRITE command generates a break at line end.

 

 

 

Example

In this example, the « C:\temp\text.txt » file is opened for writing, while its current content is deleted. Program will, then, writes a text into the file.

 

CHGVAR

VAR(&CMD) VALUE('FILEOPEN')

CHGVAR

VAR(&PARM1) VALUE('File="C:\Temp\text.txt";Truncate=True')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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


CHGVAR

VAR(&CMD) VALUE('FILEWRITE')

CHGVAR

VAR(&PARM1) VALUE(&INPUT)

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

 

See also

Command FILEWRITE

Command FILECLOSE