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

Writes into file, previously opened with FILEOPEN.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('FILEWRITE')

CHGVAR

VAR(&PARM1) VALUE('Text to write in the file')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

Parameters

 

Parameters

 

Parm1

Text to write into the file.

Text is added at file end.

 

 

Example

 

In this example « C:\temp\text.txt » file is opened for writing, while its current content is deleted.
Program will, then, write 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('Text... ')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

 

Note

If the value to write contains a semicolon, you have to put the value between double quotes :

 

  LNCCMD CMD(FILEWRITE) PARM1('"aaa;bbb;ccc;ddd"')

 

See also

Command FILEOPEN

Command FILECLOSE