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

 Closes the text file previously opened with FILEOPEN.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('FILECLOSE')

CHGVAR

VAR(&PARM1) VALUE(' ')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

 

Example

 

In this example, the « C:\temp\text.txt » file is write enabled and current content is deleted.
The program will, then, write a text into the file and close it.

 

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(‘Texte à écrire dans le fichier’)

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

 

CHGVAR

VAR(&CMD) VALUE('FILECLOSE')

CHGVAR

VAR(&PARM1) VALUE(' ')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

 

 

 

 

 

Other example

LNCCMD     CMD(FILECLOSE)

 

 

 

See also

Command FILEOPEN

Command FILEWRITE