UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
STATUS Function Return Values After you execute READBCKL, the STATUS function returns one of the values described in the following table. Value Description 0 Successful read. Example This example uses the following program to lock the CLIENT file for two minutes: 1-604 UniBasic Commands Reference 10 UniBasic found and read a duplicate alternate index key value, and ECL DUP.STATUS is on. STATUS Function Return Values OPEN "CLIENTS" TO CLIENT.FILE ELSE STOP FILELOCK CLIENT.FILE LOCKED PRINT "CLIENTS FILE already locked." SLEEP 120 FILEUNLOCK CLIENT.FILE If you execute the following program: OPEN 'CLIENTS' TO tmp ELSE STOP SETINDEX 'LNAME', 'Smith' ON tmp FOR X = 1 TO 5 READBCKL rec FROM tmp THEN PRINT rec:", ":rec:" ":rec ELSE STOP NEXT X END Notice that execution halts on the second program until the first program unlocks the CLIENTS file. This is because commands that set shared locks cannot access files locked with exclusive locks (FILELOCK sets an exclusive lock). Note: If the first program had set a shared lock, the second program would have been able to read the records.
Related Commands UniBasic READBCK, READBCKU, READFWD, READFWDL, READFWDU, READXBCK, READXFWD, SELECTINDEX, SETINDEX UniData BUILD.INDEX, CREATE.INDEX, DEFAULT.LOCKED.ACTION, DUP.STATUS – For information, see the UniData Commands Reference. READBCKL 1-605
- 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
- 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 648 and 649: READBCKU Syntax READBCKU dyn.array.
- Page 650 and 651: STATUS Function Return Values After
- Page 652 and 653: READFWD Syntax READFWD dyn.array.va
- Page 654 and 655: Example In the following example, t
- Page 656 and 657: Parameters The following table desc
- Page 658 and 659: Related Commands UniBasic READBCK,
- Page 660 and 661: Parameters The following table desc
- Page 662 and 663: Related Commands UniBasic READBCK,
- Page 664 and 665: Parameters The following table desc
- Page 666 and 667: UniData DEFAULT.LOCKED.ACTION - For
- Page 668 and 669: Parameters The following table desc
- Page 670 and 671: READNEXT Syntax READNEXT id.var [,
- Page 672 and 673: Parameter Description Examples In t
- Page 674 and 675: READNEXTTUPLE Syntax READNEXTTUPLE
- Page 676 and 677: Example In the following example, t
- Page 678 and 679: READSEQ Syntax READSEQ var FROM seq
- Page 680 and 681: eadSocket Syntax readSocket(socket_
- Page 682 and 683: READT Syntax READT [UNIT (mu.expr)]
- Page 684 and 685: Example In the following example, t
- Page 686 and 687: Parameters The following table desc
- Page 688 and 689: Related Commands UniBasic CLOSE, DE
- Page 690 and 691: Parameter Description Examples In t
- Page 692 and 693: READVL Syntax READVL var FROM [file
- Page 694 and 695: Example In the following example, R
STATUS Function Return Values<br />
After you execute READBCKL, the STATUS function returns one of the values<br />
described in the following table.<br />
Value Description<br />
0 Successful read.<br />
Example<br />
This example uses the following program to lock the CLIENT file for two minutes:<br />
1-604 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
10 <strong>UniBasic</strong> found and read a duplicate alternate index key value, and ECL<br />
DUP.STATUS is on.<br />
STATUS Function Return Values<br />
OPEN "CLIENTS" TO CLIENT.FILE ELSE STOP<br />
FILELOCK CLIENT.FILE LOCKED PRINT "CLIENTS FILE already locked."<br />
SLEEP 120<br />
FILEUNLOCK CLIENT.FILE<br />
If you execute the following program:<br />
OPEN 'CLIENTS' TO tmp ELSE STOP<br />
SETINDEX 'LNAME', 'Smith' ON tmp<br />
FOR X = 1 TO 5<br />
READBCKL rec FROM tmp THEN PRINT rec:", ":rec:" ":rec<br />
ELSE STOP<br />
NEXT X<br />
END<br />
Notice that execution halts on the second program until the first program unlocks the<br />
CLIENTS file. This is because commands that set shared locks cannot access files<br />
locked with exclusive locks (FILELOCK sets an exclusive lock).<br />
Note: If the first program had set a shared lock, the second program would have been<br />
able to read the records.