UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
READT Syntax READT [UNIT (mu.expr)] var {THEN statements [END] | ELSE statements [END]} Description The UniBasic READT command reads the next record from a tape and assigns it to a variable. Note: Before you use the READT command, you must attach a tape drive with the T.ATT command. For information about tape commands, see the UniData Commands Reference. You must use the TAPELEN option for the T.ATT command and specify the length of the tape in megabytes. This command is intended for use with UniData tapes only. UniData uses the ASCII 0 character (CHAR(0)) as an end-of-record mark. Therefore, you cannot use ASCII 0 in any string variable in UniBasic. READT converts (CHAR(0)) to CHAR(128). 1-640 UniBasic Commands Reference
Parameters The following table describes each parameter of the syntax. Parameter Description UNIT (mu.expr) Specifies the conversion code (first digit), and the unit number (second digit). UniData allows unit numbers from 0 through 9. mu.expr is optional. The default value is 00, indicating tape unit 0 and no conversion: 0 – No conversion (ASCII assumed) 1 – EBCDIC conversion 2 – Invert high bit 3 – Swap bytes var Specifies a variable to contain the record. 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 does not exist. END is required to terminate multiline ELSE statements. READT Parameters STATUS Function Return Values After you execute READT, the STATUS function returns one of the values described in the following table. Value Description 0 Successful read. 1 End of file encountered. 2 End of tape encountered. 3 Tape not assigned. STATUS Function Return Values READT 1-641
- 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
- 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 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
- Page 696 and 697: Parameters The following table desc
- Page 698 and 699: READXBCK Syntax READXBCK dyn.array.
- Page 700 and 701: READXFWD Syntax READXFWD dyn.array.
- Page 702 and 703: ReadXMLData Syntax ReadXMLData(xml_
- Page 704 and 705: RECORDLOCKED Syntax RECORDLOCKED (f
- Page 706 and 707: STATUS Function Return Values After
- Page 708 and 709: Parameter Description Examples In t
- Page 710 and 711: RECORDLOCKU Syntax RECORDLOCKU [fil
- Page 712 and 713: RELEASE Syntax RELEASE [file.var [,
- Page 714 and 715: ReleaseXML Syntax ReleaseXML(XMLhan
- Page 716 and 717: Example In the following example, c
- Page 718 and 719: Parameter Description The SETTING c
- Page 720 and 721: In some implementations, the values
- Page 722 and 723: REMOVE Syntax REMOVE(dyn.array.var,
- Page 724 and 725: REPLACE Syntax REPLACE(dyn.array.ex
- Page 726 and 727: In the next example, the program se
- Page 728 and 729: RESIZET Syntax RESIZET [UNIT(mu.exp
- Page 730 and 731: RETURN Syntax RETURN [TO label[:]]
READT<br />
Syntax<br />
READT [UNIT (mu.expr)] var {THEN statements [END] | ELSE statements<br />
[END]}<br />
Description<br />
The <strong>UniBasic</strong> READT command reads the next record from a tape and assigns it to<br />
a variable.<br />
Note: Before you use the READT command, you must attach a tape drive with the<br />
T.ATT command. For information about tape commands, see the UniData<br />
<strong>Commands</strong> <strong>Reference</strong>. You must use the TAPELEN option for the T.ATT command<br />
and specify the length of the tape in megabytes. This command is intended for use<br />
with UniData tapes only.<br />
UniData uses the ASCII 0 character (CHAR(0)) as an end-of-record mark. Therefore,<br />
you cannot use ASCII 0 in any string variable in <strong>UniBasic</strong>. READT converts<br />
(CHAR(0)) to CHAR(128).<br />
1-640 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>