UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Parameter Description The SETTING clause assigns the variable delim.var a value based on the type of delimiter encountered. The following table describes the values of the delimiter codes. *ASCII value is language-dependent and can be reassigned. 1-676 UniBasic Commands Reference FROM dyn.var Specifies a dynamic array from which to remove elements. AT col.pos Specifies the position in the array at which to start removing elements. This position is the number of characters, including system delimiters, from the beginning of the array. To process the entire array, set col.pos to 1 (0 defaults to 1). The value of col.pos changes as the array is processed, indicating the current position of the pointer. SETTING delim.var Specifies the delimiter code. When the end of the array is encountered, delim.var is set to 0. REMOVE Parameters (continued) Delimiete r Code Description ASCII Value* 0 array end 1 record mark 255 2 attribute mark 254 3 value mark 253 4 subvalue mark 252 5 text mark 251 6 not used; nonprinting 250 7 not used; nonprinting 249 REMOVE Delimiter Codes
Examples In the following example, the program segment processes the dynamic array CLIENT: DIM VAR(5,2) CLIENT = "G.Flaubert":@VM:"Guy":@SM:"12":@VM:"Yvette":@SM:"7" FOR I = 1 TO 5 REMOVE VAR(I,1) FROM CLIENT SETTING VAR(I,2) NEXT I CLIENT = CLIENT;*reset REMOVE pointer After the loop terminates, VAR contains the following: VAR(1,1) = "G.Flaubert" VAR(1,2) = 3 VAR(2,1) = "Guy" VAR(2,2) = 4 VAR(3,1) = "12" VAR(3,2) = 3 VAR(4,1) = "Yvette" VAR(4,2) = 4 VAR(5,1) = "7" VAR(5,2) = 0 Notice that each element in the array VAR contains the extracted array element and the associated delimiter. In the next example, the program segment starts at the beginning of the array AMOUNTS, successively removes each element from the array, calculates a 3.5 percent tax amount, and adds it into the variable TAX.AMT. When MARK = 0 (delim.var is 0), processing terminates. COL = 1 LOOP REMOVE INV.AMT FROM AMOUNTS AT COL SETTING MARK TAX.AMT += INV.AMT*.035 WHILE MARK DO REPEAT In the next example, the program segment demonstrates the difference between UniBasic and other implementations of BASIC: ARRAY = "AB":@AM:"CD":@AM:"EF" COL = 1 LOOP REMOVE LINE FROM ARRAY AT COL SETTING MARK PRINT LINE, COL, MARK WHILE MARK REPEAT In UniBasic, the result is the following: AB 4 2 CD 7 2 EF 9 0 REMOVE 1-677
- 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
- 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 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 744 and 745: SELECT Syntax SELECT file.var [TO {
- 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
Examples<br />
In the following example, the program segment processes the dynamic array<br />
CLIENT:<br />
DIM VAR(5,2)<br />
CLIENT = "G.Flaubert":@VM:"Guy":@SM:"12":@VM:"Yvette":@SM:"7"<br />
FOR I = 1 TO 5<br />
REMOVE VAR(I,1) FROM CLIENT SETTING VAR(I,2)<br />
NEXT I<br />
CLIENT = CLIENT;*reset REMOVE pointer<br />
After the loop terminates, VAR contains the following:<br />
VAR(1,1) = "G.Flaubert" VAR(1,2) = 3<br />
VAR(2,1) = "Guy" VAR(2,2) = 4<br />
VAR(3,1) = "12" VAR(3,2) = 3<br />
VAR(4,1) = "Yvette" VAR(4,2) = 4<br />
VAR(5,1) = "7" VAR(5,2) = 0<br />
Notice that each element in the array VAR contains the extracted array element and<br />
the associated delimiter.<br />
In the next example, the program segment starts at the beginning of the array<br />
AMOUNTS, successively removes each element from the array, calculates a 3.5<br />
percent tax amount, and adds it into the variable TAX.AMT. When MARK = 0<br />
(delim.var is 0), processing terminates.<br />
COL = 1<br />
LOOP<br />
REMOVE INV.AMT FROM AMOUNTS AT COL SETTING MARK<br />
TAX.AMT += INV.AMT*.035<br />
WHILE MARK DO REPEAT<br />
In the next example, the program segment demonstrates the difference between<br />
<strong>UniBasic</strong> and other implementations of BASIC:<br />
ARRAY = "AB":@AM:"CD":@AM:"EF"<br />
COL = 1<br />
LOOP<br />
REMOVE LINE FROM ARRAY AT COL SETTING MARK<br />
PRINT LINE, COL, MARK<br />
WHILE MARK REPEAT<br />
In <strong>UniBasic</strong>, the result is the following:<br />
AB 4 2<br />
CD 7 2<br />
EF 9 0<br />
REMOVE 1-677