$ItsOpen: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (That's a data line, not a header)
No edit summary
Line 25: Line 25:
END
END
</p>
</p>
==See also==
<ul>
<li>[[$Context]], which returns a number to indicate whether the context is a file or group.
</ul>
[[Category:SOUL $functions]]
[[Category:SOUL $functions]]

Revision as of 10:23, 28 June 2017

The $ITSOPEN function lets you determine whether a file is open. $ITSOPEN only checks files, not groups of files. The return codes are:

0 the file is not open
1 the file is open

Syntax

The format for the $ITSOPEN function is:

$ITSOPEN({[FILE] name [AT location] | [PERM | TEMP] [GROUP] name})

where name (optional) is a %variable or a literal name of the file or group. You must enter the filename in uppercase. A file synonym name can also be used. If you do not enter a location (specifying a null argument), Model 204 uses the reference context (at compile time) of the statement which calls the function.

Example

BEGIN %FILE IS STRING LEN 8 %FILE = $READ('ENTER THE FILENAME') IF $ITSOPEN(%FILE) THEN PRINT %FILE ' IS OPEN' ELSE PRINT %FILE ' IS NOT OPEN' END

See also

  • $Context, which returns a number to indicate whether the context is a file or group.