UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

Parameters The following table describes each parameter of the syntax. Parameter Description 1-559 UniBasic Commands Reference filename Specifies the file to open. filename must include the entire path name unless the file resides in the current directory. READONLY Directs UniData to open the file for reading only. If the program attempts to write to a file opened in READONLY mode, UniData displays a runtime error message and does not update the file. For information about security procedures, see Administering UniData on UNIX or Administering UniData on Windows Platforms. WRITEONLY Specifies that the pipe or file is open for write access only. TO file.var Specifies a variable to contain a pointer to the file. NODELAY Forces a pipe to be opened immediately. This enables a process to continue even when the pipe is not open in the opposite access mode. The application must then manage access to the pipe to ensure that it is opened for the opposite process before reading from or writing to it. If filename is not a named pipe, NODELAY has no effect. ON ERROR statements Specifies statements to execute if the OSOPEN statement fails with a fatal error because the file is not open, an I/O error occurs, or UniData cannot find the file. If you do not specify the ON ERROR clause and a fatal error occurs, the program terminates. THEN statements END THEN executes if the read is successful. END is required to terminate multiline THEN statements. ELSE statements END ELSE executes if the read is not successful or the record (or ID) does not exist. END is required to terminate multiline ELSE statements. OSOPEN Parameters

Example In the following example, the program statement opens the file INVENTORY as INVENT unless UniData cannot access the file. OSOPEN 'INVENTORY' TO INVENT ELSE STOP "Can't open INVENTORY" Related Commands UniBasic CLOSESEQ, OPEN, OPENSEQ, OSBREAD, OSBWRITE, OSCLOSE, OSDELETE, READSEQ, WRITESEQ, WRITESEQF OSOPEN 1-560

Example<br />

In the following example, the program statement opens the file INVENTORY as<br />

INVENT unless UniData cannot access the file.<br />

OSOPEN 'INVENTORY' TO INVENT ELSE STOP "Can't open INVENTORY"<br />

Related <strong>Commands</strong><br />

<strong>UniBasic</strong><br />

CLOSESEQ, OPEN, OPENSEQ, OSBREAD, OSBWRITE, OSCLOSE,<br />

OSDELETE, READSEQ, WRITESEQ, WRITESEQF<br />

OSOPEN 1-560

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!