Chapter 6 RAPID!
Functions
WCDMA Options Version 6.20
193
DIR$
EOF
Description
Returns a string containing the system date in the fol-
lowing format: "mmm-dd-jjjj", where "mmm" represent a
three-letter abbreviation of the month, "dd" stand for the
integer, giving the day of the month and "jjjj" represent
the current system year in four-digit code.
Examples
DATE$ would have returned "Jan-03-2001" on the day
this subsection was created.
Syntax
DIR$ [ (path$) ]
Parameters
path$ is a valid string expression.
Description
Returns an entry in the directory specified with the
optional command element
path$.
DIR$ will read the first entry in the specified directory
only. Repeated
DIR$ function calls (without the path
command element) will read out the subsequent entries
of the currently selected directory one by one. If there are
no more entries, an empty string will be returned.
path$ may either contain the absolute or relative path.
If
path$ is not a valid path, the returned DIR$ will be
empty and a runtime error will occur.
Example
The following example will print a list of all entries in the
directory specified.
PRINT "Directory entries:";DIR$("/
home")
DO d$ = DIR$
IF d$ = "" THEN EXIT DO
PRINT d$
LOOP
Syntax
EOF(fileHandle)
Parameters
fileHandle is a numeric expression, interpreted as
positive integer.
Description
Checks whether the end of the file, specified by
file-
Handle
, has been reached.
If so,
EOF will return 1 (or true), otherwise 0 (or false).
fileHandle needs to be a currently valid file handle,
and the file needs to be opened first, before
EOF may be
used (otherwise, a runtime error will occur).
Note: When you try to read from a file with the INPUT
command after the end of the file was reached, a runt-
ime error will occur. To avoid that, it is highly recom-
mended to check
EOF, before you issue an INPUT
command.