UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Related Command UniBasic EXIT 1-165 UniBasic Commands Reference
CONVERT Syntax CONVERT expr1 TO expr2 IN var Description The UniBasic CONVERT command changes all occurrences of the substring expr1 in var to the string expr2. UniBasic compares each character of the replacement string expr2 and, if necessary, replaces each character of the target string expr1 on an individual basis. UniBasic does not compare and insert strings as a whole. CONVERT supports multibyte languages. CONVERT can delete characters from a string, but it does not insert additional characters. If the replacement substring expr2 contains more characters than are in the substring it replaces (expr1), the extra characters are ignored. Parameters The following table describes each parameter of the syntax. Examples Parameter Description expr1 Specifies the target string to replace with expr2. expr2 Specifies the string with which to replace expr1. var Specifies the string to search for expr1. CONVERT Parameters In the following example, the program segment converts all occurrences of 1 to 3 and all occurrences of 2 to 4. The new contents of NSTRING becomes 34,0,03,35,44. NSTRING = "12,0,01,15,22" CONVERT "12" TO "34" IN NSTRING CONVERT 1-166
- Page 112 and 113: BREAK Syntax BREAK [KEY] {ON | OFF
- Page 114 and 115: BYTELEN Syntax BYTELEN (string) Des
- Page 116 and 117: Example In the following example, t
- Page 118 and 119: Parameters The following table desc
- Page 120 and 121: CALLC Syntax CALLC c.sub.name [(arg
- Page 122 and 123: CASE Syntax BEGIN CASE CASE express
- Page 124 and 125: In the next example, the program se
- Page 126 and 127: Related Commands UniBasic CATS, SPL
- Page 128 and 129: CHAIN Syntax CHAIN "str.expr" Descr
- Page 130 and 131: CHANGE Syntax CHANGE(string, old.su
- Page 132 and 133: CHAR Syntax CHAR(expr) Description
- Page 134 and 135: CHARLEN Syntax CHARLEN (string) Des
- Page 136 and 137: CHECKSUM Syntax CHECKSUM(str.expr)
- Page 138 and 139: Related Commands UniBasic COMMON, C
- Page 140 and 141: UniData DELETECOMMON, STACKCOMMON -
- Page 142 and 143: CLEARFILE Syntax CLEARFILE [file.va
- Page 144 and 145: CLEARINPUT Syntax CLEARINPUT Synony
- Page 146 and 147: UniQuery GET.LIST, SELECT, SSELECT
- Page 148 and 149: CLOSE Syntax CLOSE [file.var] [ON E
- Page 150 and 151: CLOSESEQ Syntax CLOSESEQ seq.file.v
- Page 152 and 153: closeSocket Syntax closeSocket(sock
- Page 154 and 155: COL1 Syntax COL1( ) Description The
- Page 156 and 157: COMMON Syntax COMMON [/common.name/
- Page 158 and 159: 1-161 UniBasic Commands Reference
- Page 160 and 161: UniData DELETECOMMON, STACKCOMMON -
- Page 164 and 165: In the next example, the program se
- Page 166 and 167: In the next example, the program se
- Page 168 and 169: COUNT Syntax COUNT(str.expr1, str.e
- Page 170 and 171: COUNTS Syntax COUNTS(expr,str.expr)
- Page 172 and 173: createCertificate Syntax createCert
- Page 174 and 175: createCertRequest Syntax createCert
- Page 176 and 177: Parameter Description The following
- Page 178 and 179: The following table describes the a
- Page 180 and 181: createSecureRequest Syntax createSe
- Page 182 and 183: Method Description The following ta
- Page 184 and 185: Parameters The following table desc
- Page 186 and 187: DATA Syntax DATA expr1 [,expr2]...
- Page 188 and 189: DBTOXML Syntax DBTOXML(xml_document
- Page 190 and 191: DCOUNT Syntax DCOUNT(str,delim) Des
- Page 192 and 193: DEACTIVATEKEY Syntax DEACTIVATEKEY
- Page 194 and 195: STATUS Code Example The following e
- Page 196 and 197: DEFFUN Syntax DEFFUN function.name
- Page 198 and 199: The preceding program calls the fol
- Page 200 and 201: Examples The following program segm
- Page 202 and 203: Examples The following program stat
- Page 204 and 205: In the next example, the program st
- Page 206 and 207: UniData SQL SELECT - For informatio
- Page 208 and 209: Examples In the following example,
- Page 210 and 211: Parameters The following table desc
CONVERT<br />
Syntax<br />
CONVERT expr1 TO expr2 IN var<br />
Description<br />
The <strong>UniBasic</strong> CONVERT command changes all occurrences of the substring expr1<br />
in var to the string expr2. <strong>UniBasic</strong> compares each character of the replacement<br />
string expr2 and, if necessary, replaces each character of the target string expr1 on an<br />
individual basis. <strong>UniBasic</strong> does not compare and insert strings as a whole.<br />
CONVERT supports multibyte languages.<br />
CONVERT can delete characters from a string, but it does not insert additional<br />
characters. If the replacement substring expr2 contains more characters than are in<br />
the substring it replaces (expr1), the extra characters are ignored.<br />
Parameters<br />
The following table describes each parameter of the syntax.<br />
Examples<br />
Parameter Description<br />
expr1 Specifies the target string to replace with expr2.<br />
expr2 Specifies the string with which to replace expr1.<br />
var Specifies the string to search for expr1.<br />
CONVERT Parameters<br />
In the following example, the program segment converts all occurrences of 1 to 3 and<br />
all occurrences of 2 to 4. The new contents of NSTRING becomes 34,0,03,35,44.<br />
NSTRING = "12,0,01,15,22"<br />
CONVERT "12" TO "34" IN NSTRING<br />
CONVERT 1-166