UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
READSEQ Syntax READSEQ var FROM seq.file.var {THEN statements [END] | ELSE statements [END]} Description The UniBasic READSEQ command reads the next record from a sequential file and assigns the data read to a variable. Note: Before you use READSEQ, you must open the file by using the OSOPEN or OPENSEQ command. If the file is a named pipe, you cannot use READSEQ to read it. You must use the OSBREAD command. Each read from the sequential file searches for a line feed character [CHAR(10)] to determine the end of the record. READSEQ maintains a pointer to the current position in the file (where the last record terminated). Parameters The following table describes each parameter of the syntax. Parameter Description 1-636 UniBasic Commands Reference var Specifies a variable to which to assign the record. READSEQ Parameters
Parameter Description FROM seq.file.var Specifies a sequential file from which to read the record. seq.file.var must be a sequential file opened by using an OPENSEQ or OSOPEN statement. 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. Example In the following example, the program statement reads the next record in the file PORT.FILE and assigns it to the variable TAX.REC: READSEQ TAX.REC FROM PORT.FILE ELSE STOP "Can’t READSEQ TAX.REC" Related Commands UniBasic READSEQ Parameters (continued) CLOSESEQ, OPENSEQ, OSBREAD, OSBWRITE, OSCLOSE, OSDELETE, OSOPEN, WRITESEQ, WRITESEQF READSEQ 1-637
- 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
- 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 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
- 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
Parameter Description<br />
FROM seq.file.var Specifies a sequential file from which to read the record.<br />
seq.file.var must be a sequential file opened by using an<br />
OPENSEQ or OSOPEN statement.<br />
THEN statements END THEN executes if the read is successful. END is required to<br />
terminate multiline THEN statements.<br />
ELSE statements END ELSE executes if the read is not successful or the record does not<br />
exist. END is required to terminate multiline ELSE statements.<br />
Example<br />
In the following example, the program statement reads the next record in the file<br />
PORT.FILE and assigns it to the variable TAX.REC:<br />
READSEQ TAX.REC FROM PORT.FILE ELSE STOP "Can’t READSEQ TAX.REC"<br />
Related <strong>Commands</strong><br />
<strong>UniBasic</strong><br />
READSEQ Parameters (continued)<br />
CLOSESEQ, OPENSEQ, OSBREAD, OSBWRITE, OSCLOSE, OSDELETE,<br />
OSOPEN, WRITESEQ, WRITESEQF<br />
READSEQ 1-637