UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
SELECT Syntax SELECT file.var [TO {list.num.expr | list.var.expr}] [ON ERROR statements] SELECT dyn.array [TO {list.num.expr | list.var.expr}] [ON ERROR statements] Description The UniBasic SELECT command creates an active select list of all record IDs in a file. Records appear in the list in the order in which they are stored in the file. You can access the select list with a READNEXT statement. The UniBasic SELECT command differs from EXECUTE "SELECT ...", which executes the UniQuery SELECT command. The UniBasic SELECT command immediately makes available to READNEXT one group of IDs at a time. The program does not have to wait for the entire ID list to be constructed. If changes occur in a group that has not been selected yet, those changes are reflected in the select list that is being read by the program. If an ID is deleted before the group is selected by the UniBasic program, that ID does not appear in the list. Record IDs are truncated at 96 characters when they are copied into the select list. When using the UniQuery SELECT command, SYSTEM(11) returns the number of items remaining in the list. With the UniBasic SELECT command, SYSTEM(11) returns the number of items remaining in the group. Note: You can specify named or numbered lists (using list.num.expr or list.var.expr) in BASICTYPEs R and U. Only named lists (list.var.expr) are supported in BASICTYPEs M and P. 1-702 UniBasic Commands Reference
Parameters The following table describes each parameter of the syntax. Parameter Description file.var Specifies a file variable from which to read record IDs. If you do not specify a file.var, UniData reads from the default file. If no default file is open, a fatal error occurs. The default file is one for which no file variable is assigned in the OPEN statement. dyn.array Specifies a dynamic array from which to select a list of attributes. TO list.num.expr Supported in BASICTYPEs R and U only. Specifies a numbered select list, 0–9, to contain record IDs. If you do not specify a list, SELECT creates list 0. TO list.var.expr Supported in all BASICTYPEs. Specifies a named select list to contain record IDs. Initialize list.var.expr with a statement like list.name = '' before using it in the SELECT statement to avoid a compiler warning for an uninitialized variable. ON ERROR statements Specifies statements to execute if the SELECT 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. SELECT Parameters SELECT 1-703
- 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[:]]
- Page 732 and 733: Examples In the following example,
- Page 734 and 735: Example In the following example, t
- Page 736 and 737: RNDSEED Syntax RNDSEED expr Descrip
- Page 738 and 739: SADD Syntax SADD(x, y) Description
- Page 740 and 741: The following table describes the s
- Page 742 and 743: Example In the following example, t
- Page 746 and 747: Examples The following program segm
- Page 748 and 749: SELECTINDEX Syntax SELECTINDEX inde
- Page 750 and 751: Related Commands UniBasic DELETELIS
- Page 752 and 753: Related Commands UniBasic DELETELIS
- Page 754 and 755: Note: SEND with the X option suppre
- Page 756 and 757: SEQS Syntax SEQS("char.expr") Descr
- Page 758 and 759: The following table describes the s
- Page 760 and 761: Parameters The following table desc
- Page 762 and 763: The following table describes the s
- Page 764 and 765: setHTTPDefault Syntax setHTTPDefaul
- Page 766 and 767: The following table describes the s
- Page 768 and 769: Parameters The following table desc
- Page 770 and 771: Examples In the following example,
- Page 772 and 773: setPrivateKey Syntax setPrivateKey(
- Page 774 and 775: setRandomSeed Syntax setRandomSeed(
- Page 776 and 777: setRequestHeader Syntax setRequestH
- Page 778 and 779: setSocketOptions Syntax setSocketOp
- Page 780 and 781: showSecurityContext Syntax showSecu
- Page 782 and 783: SIGNATURE Syntax SIGNATURE(algorith
- Page 784 and 785: Return Code Status 1-742 UniBasic C
- Page 786 and 787: SLEEP Syntax SLEEP [hh:mm[:ss]] [se
- Page 788 and 789: SMUL Syntax SMUL(x, y) Description
- Page 790 and 791: Return Codes The return code indica
- Page 792 and 793: The following table describes each
SELECT<br />
Syntax<br />
SELECT file.var [TO {list.num.expr | list.var.expr}] [ON ERROR statements]<br />
SELECT dyn.array [TO {list.num.expr | list.var.expr}] [ON ERROR statements]<br />
Description<br />
The <strong>UniBasic</strong> SELECT command creates an active select list of all record IDs in a<br />
file. Records appear in the list in the order in which they are stored in the file.<br />
You can access the select list with a READNEXT statement.<br />
The <strong>UniBasic</strong> SELECT command differs from EXECUTE "SELECT ...", which<br />
executes the UniQuery SELECT command. The <strong>UniBasic</strong> SELECT command<br />
immediately makes available to READNEXT one group of IDs at a time. The<br />
program does not have to wait for the entire ID list to be constructed.<br />
If changes occur in a group that has not been selected yet, those changes are reflected<br />
in the select list that is being read by the program. If an ID is deleted before the group<br />
is selected by the <strong>UniBasic</strong> program, that ID does not appear in the list.<br />
Record IDs are truncated at 96 characters when they are copied into the select list.<br />
When using the UniQuery SELECT command, SYSTEM(11) returns the number of<br />
items remaining in the list. With the <strong>UniBasic</strong> SELECT command, SYSTEM(11)<br />
returns the number of items remaining in the group.<br />
Note: You can specify named or numbered lists (using list.num.expr or list.var.expr)<br />
in BASICTYPEs R and U. Only named lists (list.var.expr) are supported in<br />
BASICTYPEs M and P.<br />
1-702 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>