UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
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
- Page 548 and 549: OCONV Right Justify (MR) Syntax OCO
- Page 550 and 551: Examples In the following statement
- Page 552 and 553: Related Commands UniBasic DATE, ICO
- Page 554 and 555: The following table indicates which
- Page 556 and 557: OCONV Pattern Match (P) Syntax OCON
- Page 558 and 559: OCONV Range (R) Syntax OCONV(num.ex
- Page 560 and 561: OCONV SOUNDEX (S) Syntax OCONV(str.
- Page 562 and 563: OCONV Text Extraction (T) Syntax OC
- Page 564 and 565: OCONV File Translation (Tfile) Synt
- Page 566 and 567: OCONVS Syntax OCONVS(dyn.array.expr
- Page 568 and 569: ON/GOSUB Syntax ON expr GOSUB label
- Page 570 and 571: Related Commands UniBasic GOSUB, GO
- Page 572 and 573: Parameters The following table desc
- Page 574 and 575: Parameter Description 1-535 UniBasi
- Page 576 and 577: openSecureSocket function Syntax op
- Page 578 and 579: OPENSEQ Syntax OPENSEQ [absolutepat
- Page 580 and 581: STATUS Function Return Values After
- Page 582 and 583: The following table describes the r
- Page 584 and 585: Example The following example illus
- Page 586 and 587: OSBREAD Syntax OSBREAD var FROM fil
- Page 588 and 589: STATUS Function Return Values After
- Page 590 and 591: Writing to Other Types of Files For
- Page 592 and 593: Related Commands UniBasic CLOSESEQ,
- Page 594 and 595: Example In the following example, t
- Page 596 and 597: STATUS Function Return Values After
- Page 600 and 601: OSREAD Syntax OSREAD var FROM filen
- Page 602 and 603: OSWRITE Syntax OSWRITE expr {ON | T
- Page 604 and 605: PAGE Syntax PAGE [ON num.expr] [exp
- Page 606 and 607: PAUSE Syntax PAUSE [wait_time] Desc
- Page 608 and 609: PCPERFORM Syntax PCPERFORM str.expr
- Page 610 and 611: PERFORM PERFORM is a synonym for th
- Page 612 and 613: Related Command UniData FLOAT.PRECI
- Page 614 and 615: Example The following example illus
- Page 616 and 617: Parameters The following table desc
- Page 618 and 619: PRINTER Syntax PRINTER {ON | OFF} D
- Page 620 and 621: PRINTERR Syntax PRINTERR expr [FROM
- Page 622 and 623: Code Description Examples In the fo
- Page 624 and 625: PROCREAD Syntax PROCREAD var {THEN
- Page 626 and 627: The following globally cataloged pr
- Page 628 and 629: PROCWRITE Syntax PROCWRITE expr Des
- Page 630 and 631: PROMPT Syntax PROMPT str.expr Descr
- Page 632 and 633: protocolLogging Syntax protocolLogg
- Page 634 and 635: PWR Syntax PWR(num.expr1, num.expr2
- Page 636 and 637: Related Command UniBasic SQUOTE 1-5
- Page 638 and 639: READ Syntax READ dyn.array.var FROM
- Page 640 and 641: Example In the following example, t
- Page 642 and 643: Parameters The following table desc
- Page 644 and 645: READBCKL Syntax READBCKL dyn.array.
- Page 646 and 647: STATUS Function Return Values After
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