Work preparation
3.5 File handling
c) Write to an external file with explicitly generated "LF"
The following must be programmed in order to achieve the same result as under a:
Program code
...
N200 DEF STRING[30] DEV_1
N210 DEF INT ERROR
N220 DEV_1="LOCAL_DRIVE/myprotfile.mpf"
N230 EXTOPEN(ERROR,DEV_1)
N240 WRITE(ERROR,DEV_1,"MY_STRING'H0A'")
N250 WRITE(ERROR,DEV_1,"MY_STRING'H0A'")
N260 EXTCLOSE(ERROR,DEV_1)
N270 M30
Output result:
MY_STRING
MY_STRING
3.5.2
Delete file (DELETE)
The DELETE command deletes all files, irrespective of whether these were created using
the WRITE command or not. Files that were created using a higher access authorization can
also be deleted with DELETE.
Syntax
DEF INT <error>
DELETE(<error>,"<file name>")
Meaning
DELETE:
<error>:
568
Command for deleting the specified file.
Variable for returning the error value.
Type.
INT
Value:
0
No error
1
Path not allowed
2
Path not found
3
File not found
4
Incorrect file type
11
The file is in use
12
No resources available
20
Other error
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0
NC programming