$ItsOpen: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (needed a length)
m (That's a data line, not a header)
Line 1: Line 1:
<p>The $ITSOPEN function lets you determine whether a file is open. $ITSOPEN only checks files, not groups of files. The return codes are: </p>
<p>The $ITSOPEN function lets you determine whether a file is open. $ITSOPEN only checks files, not groups of files. The return codes are:</p>
<table>
<table>
<tr class="head">
<tr>
<th align="right">0</th>
<td>0</td>
<th>the file is not open</th>
<td>the file is not open</td>
</tr>
</tr>
<tr>
<tr>
<td align="right">1</td>
<td>1</td>
<td>the file is open </td>
<td>the file is open</td>
</tr>
</tr>
</table>
</table>
<b>Syntax</b>
<b>Syntax</b>
<p>The format for the $ITSOPEN function is:</p>
<p>The format for the $ITSOPEN function is:</p>
<p class="code">$ITSOPEN({[FILE] name [AT location]
<p class="code">$ITSOPEN({[FILE] name [AT location] | [PERM | TEMP] [GROUP] name})
 
| [PERM | TEMP] [GROUP] name})
</p>
</p>
<p>where name (optional) is a %variable or a literal name of the file or group. You <var class="term">must</var> enter the filename in uppercase. A file synonym name can also be used. If you do not enter a location (specifying a null argument), <var class="product">Model&nbsp;204</var> uses the reference context (at compile time) of the statement which calls the function.</p>
<p>where name (optional) is a %variable or a literal name of the file or group. You <var class="term">must</var> enter the filename in uppercase. A file synonym name can also be used. If you do not enter a location (specifying a null argument), <var class="product">Model&nbsp;204</var> uses the reference context (at compile time) of the statement which calls the function.</p>

Revision as of 21:19, 5 November 2015

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