Advantech VisionNavi User Manual page 81

Table of Contents

Advertisement

Starts a program block where exceptions
try
are detected and caught.
Continue to execute the body as long as the
until
condition is not true.
Starts a loop block that is executed as long
while
as the condition is true.
[File(File operation)]
Function name Overview
copy_file
Copy a file to a new location.
delete_file
Delete a file.
file_exists
Check whether file exists.
list_files
List all files in a directory.
make_dir
Make a directory.
remove_dir
Delete an empty directory.
close_file
Closing a text file.
fnew_line
Create a line feed.
fread_char
Read a character from a file.
fread_line
Read a line from a file.
fread_string
Read strings from a file.
fwrite_string
Write values in a file.
open_file
Open a file in ASCII or a binary format.
The mode to open is as follows.
'input'
'output'
'append'
'input_binary'
'output_binary'
'append_binary
An already existing input file is opened for reading in ASCII format.
A new output file is opened for writing in ASCII format.
An already existing output file is opened at the end of the file for
writing in ASCII format.
An already existing input file is opened for reading in binary format.
A new output file is opened for writing in binary format.
An already existing output file is opened at the end of the file for
writing in binary format.
75
Try
...
catch (Exception)
...
UserData := ...
throw ([Exception, UserData])
endtry
repeat statement reference
while (TRUE)
...
endwhile
Example of use
copy_file('source.txt',
'dest.txt')
delete_file('delete.txt')
file_exists('exsit.txt', exist)
list_files (dir, ['files','recur-
sive'], files)
make_dir('dir')
remove_dir('dir')
close_file(handle)
fnew_line(handle)
fread_char (FileHandle, Char)
fread_line(FileHan-
dle,Line,IsEOF)
fread_string(FileHan-
dle,String,IsEOF)
fwrite_string(FileHan-
dle,['here it is again: ',String])
open_file('/tmp/log.txt','out-
put',FileHandle)
VisionNavi User Manual

Advertisement

Table of Contents
loading

Table of Contents