File Commands SECTION 6 Functions and Methods
83
Typical Example
ReadMessage ("C:\CX-SUPERVISOR\TESTFILE.TXT", 0,
TextPoint, 20)
The first 20 characters are be read from the file "C:\CX-
SUPERVISOR\TESTFILE.TXT" and stored in the point 'TextPoint'.
6-9-10 SelectFile
Syntax
filename = SelectFile (filter, path)
Remarks
Typical Example
TFile = SelectFile()
The 'File Open' dialog will be displayed, showing all files in the current working
directory. The users choice will be stored in tFile.
TFile = SelectFile("Text Files (*.txt)|*.txt||")
The 'File Open' dialog will be displayed, showing just files with a .txt extension
in the current working directory.
TFile = SelectFile("Text Files (*.txt;
*.csv)|*.txt;*.csv||")
The 'File Open' dialog will be displayed, showing files with either a .txt or .csv
extension in the current working directory.
Offset integer An offset from the beginning of the file (in
characters ) indicating where to start reading
from.
Textpoint text
point
The text point which holds the characters read
from the file.
Noofchars integer The number of characters to read from the file.
Argument Type Description
Note: Text points can hold up to 256 characters therefore a maximum of 256
characters can be read from the file.
Argument Type Description
Filename Text string returned. Contains fully qualified
filename including drive and path if OK was
selected from OpenFile comms dialog,
otherwise contains empty string.
Filter string Optional argument. If omitted, will show all
files. This argument must be supplied if path is
specified i.e. set to "". Specifies the filter string
used by the 'Files of type' list. The string
should contain 1 or more filters separated with
a '|' (pipe) character and end with 2 characters
i.e. '||'. Each filter should have some user text
and 1 or more file specs separated with a
semicolon. No spaces should be used, except
within the user text.
Path string Optional argument. Specifies the path to show
initially. If omitted, the dialog shows the current
working directory.