UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
In the next example, the program segment replaces “Blue” with the null value in STG, prints STG, then replaces the null value with “Blue” in STG, and prints STG again. The subroutine PRINT.SETUP converts attribute marks, value marks, and the null value to characters that can be displayed and printed. 1-684 UniBasic Commands Reference STG = "Movies":@AM:"The Sacrifice":@VM:"Blue":@AM:"Rocky IV" STG = REPLACE(STG,2,2,0,@NULL) GOSUB PRINT.SETUP PRINT "STG = ":PRT.STG STG = REPLACE(STG,2,2,0,"Blue") GOSUB PRINT.SETUP PRINT "STG = ":PRT.STG PRINT.SETUP: PRT.STG = CHANGE(STG, @NULL, "@NULL") PRT.STG = CHANGE(PRT.STG, @AM, "@AM") PRT.STG = CHANGE(PRT.STG, @VM, "@VM") RETURN This program prints the following: STG = Movies@AMThe Sacrifice@VM@NULL@AMRocky IV STG = Movies@AMThe Sacrifice@VMBlue@AMRocky IV In the next example, the first REPLACE places Harry Smith in the first attribute position. The second REPLACE places an array with two values in the fifth attribute. CUST.REC ='' CUST.REC = REPLACE(CUST.REC,1,0,01'Harry Smith') CUST.REC = REPLACE(CUST.REC,5,0,0,"V220":@VM:"v230") This results in: CUST.REC = "Harry Smith":@AM::@AM::@AM::@AM:"V220":@VM:"V230" In the following example, the program uses the short form of the REPLACE command to append CLIENT.NAME to NAME.ARRAY1: NAME.ARRAY1 = "Smith Jones Brown" OPEN "CLIENTS" TO CLIENT.FILE ELSE STOP READV CLIENT.NAME FROM CLIENT.FILE,"10034",2 THEN NAME.ARRAY1 = CLIENT.NAME PRINT NAME.ARRAY1 END ELSE PRINT 'NO RECORD FOR CLIENT ':CLIENT.ID END
Related Commands UniBasic DEL, DELETE, EXTRACT, INSERT, REMOVE, REPLACE REPLACE 1-685
- 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 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 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
- 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(
Related <strong>Commands</strong><br />
<strong>UniBasic</strong><br />
DEL, DELETE, EXTRACT, INSERT, REMOVE, REPLACE<br />
REPLACE 1-685