Selectfile - Omron CX-Supervisor Reference Manual

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

File Commands
Note:

6-9-10 SelectFile

Argument
Type
Offset
integer
Textpoint
text
point
Noofchars
integer
Typical Example
ReadMessage
TextPoint, 20)
The
first
20
characters
SUPERVISOR\TESTFILE.TXT" and stored in the point 'TextPoint'.
Text points can hold up to 256 characters therefore a maximum of 256
characters can be read from the file.
Syntax
filename = SelectFile (filter, path)
Remarks
Argument
Type
Filename
Filter
string
Path
string
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
=
*.csv)|*.txt;*.csv||")
The 'File Open' dialog will be displayed, showing files with either a .txt or .csv
extension in the current working directory.
SECTION 6 Functions and Methods
Description
An offset from the beginning of the file (in
characters ) indicating where to start reading
from.
The text point which holds the characters read
from the file.
The number of characters to read from the file.
("C:\CX-SUPERVISOR\TESTFILE.TXT",
are
be
read
Description
Text string returned. Contains fully qualified
filename including drive and path if OK was
selected from OpenFile comms dialog,
otherwise contains empty 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.
Optional argument. Specifies the path to show
initially. If omitted, the dialog shows the current
working directory.
SelectFile("Text
from
the
file
"C:\CX-
Files
(*.txt;
0,
83

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents