From m204wiki
Revision as of 16:36, 17 July 2017 by JAL (talk | contribs) (replace lc "o")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.


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 that calls the function.


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.