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) 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 + |
CHGVAR |
VAR(&CMD) VALUE('FILEWRITE') |
CHGVAR |
VAR(&PARM1) VALUE(&INPUT) |
CHGVAR |
VAR(&PARM2) VALUE(' ') |
CALL |
PGM(LNCCMD)
PARM(&HANDLE &CMD &OPT &PARM1 + |
See also