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. Paramete r Description Note: In BASICTYPE M or P, if expr is nonnumeric or less than 1, UniData bypasses the GOTO clause and the next program statement executes. Example In the following example, the program statement transfers program control to the statement label TEST if the variable X is less than or equal to 1. If X is 2, UniData transfers control to statement label 2500. If X is greater than or equal to 3, UniData transfers control to statement label YESNO. ON X GOTO TEST,2500, YESNO Related Commands UniBasic GOSUB, GOTO, ON/GOSUB 1-533 UniBasic Commands Reference expr Specifies a numeric expression. UniData evaluates the expression, and then truncates it to an integer. Control passes to a statement label based on the following rules: If expr is less than or equal to 1, UniData transfers program control to the label starting at the first label in the list. If the number is 2, UniData transfers control to the label starting at the second label, and so forth. If expr is higher than the number of labels, UniData transfers control to the last label in the list. If expr is nonnumeric, control transfers to the first label. label Specifies a statement label or multiple statement labels. : Optional. A colon is required to identify a nonnumeric label in the statement label itself only, not in the reference to it in the ON/GOTO statement. ON/GOTO Parameters
OPEN Syntax OPEN ["expr",] "filename" [READONLY] [TO file.var] [ON ERROR statements] {THEN statements [END] | ELSE statements [END]} Description The UniBasic OPEN command opens a UniData hashed data or dictionary file, so you can read, write, or delete records from it. The number of files you can open is determined by operating system and UniData configuration parameters. For information about file performance, see Administering UniData on UNIX or Administering UniData on Windows Platforms. Warning: Do not use UniBasic READ commands to open or modify binary data in DIR-type files (for example, BP). Doing so could corrupt data in the file. Instead, use OSREAD or OSBREAD after executing the UniBasic NOCONVERT command. Parameters The following table describes each parameter of the syntax. Parameter Description expr Specifies the portion of file type to open: “” – UniData opens a data file. DICT – UniData open a dictionary file. filename Specifies the name of the file to open. 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. OPEN Parameters OPEN 1-534
- Page 522 and 523: NUM Syntax NUM(expr) Description Th
- Page 524 and 525: NUMS Syntax NUMS(dyn.array) Descrip
- Page 526 and 527: OCONV Syntax OCONV(expr, conv.code.
- Page 528 and 529: OCONV Date (D) Syntax OCONV(integer
- Page 530 and 531: Note: Following SMA standards, Mond
- Page 532 and 533: Related Commands UniBasic DATE, ICO
- Page 534 and 535: Related Command UniBasic ICONV Grou
- Page 536 and 537: Related Command UniBasic ICONV Leng
- Page 538 and 539: Parameter Description Examples The
- Page 540 and 541: OCONV Masked Decimal (MD) Syntax OC
- Page 542 and 543: Examples The following table descri
- Page 544 and 545: Parameter Description [ [prefix], [
- Page 546 and 547: OCONV Packed Decimal (MP) Syntax OC
- 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 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 598 and 599: Parameters The following table desc
- 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
OPEN<br />
Syntax<br />
OPEN ["expr",] "filename" [READONLY] [TO file.var] [ON ERROR statements]<br />
{THEN statements [END] | ELSE statements [END]}<br />
Description<br />
The <strong>UniBasic</strong> OPEN command opens a UniData hashed data or dictionary file, so<br />
you can read, write, or delete records from it. The number of files you can open is<br />
determined by operating system and UniData configuration parameters. For information<br />
about file performance, see Administering UniData on UNIX or<br />
Administering UniData on Windows Platforms.<br />
Warning: Do not use <strong>UniBasic</strong> READ commands to open or modify binary data in<br />
DIR-type files (for example, BP). Doing so could corrupt data in the file. Instead, use<br />
OSREAD or OSBREAD after executing the <strong>UniBasic</strong> NOCONVERT command.<br />
Parameters<br />
The following table describes each parameter of the syntax.<br />
Parameter Description<br />
expr Specifies the portion of file type to open:<br />
“” – UniData opens a data file.<br />
DICT – UniData open a dictionary file.<br />
filename Specifies the name of the file to open.<br />
READONLY Directs UniData to open the file for reading only. If the program<br />
attempts to write to a file opened in READONLY mode, UniData<br />
displays a runtime error message and does not update the file. For<br />
information about security procedures, see Administering UniData on<br />
UNIX or Administering UniData on Windows Platforms.<br />
OPEN Parameters<br />
OPEN 1-534