UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Parameter Description Examples In the following example, UniData converts the value 12.339 to 1234 by rounding to two decimal places and converting to internal format: 1-347 UniBasic Commands Reference f Scales the input value num.expr by moving the decimal point f places to the right. If omitted, f defaults to the value assigned to n (for example, if you specify MD2, UniData reads it as MD22, and then ignores the first 2). dec_symbl You can specify a symbol to represent the decimal point in the input number by including dec_symbl. An example is provided in the following section. [prefix], [thsnd_mark], [suffix]] ] [,] [$] [-| < | E | C | D] [P] [Z] [T] [(xc)] INTERNAL.VAL = ICONV("12.339","MD2") The following example demonstrates how to specify that an alternate symbol is used to represent the decimal point in the input number. This example prints 12350. PRINT ICONV("123@499","MD2[,,@]") END Related Command UniBasic The ICONV function ignores these options, but they are included in the syntax to maintain consistency with the OCONV Masked Decimal (MD) function. ICONV Masked Decimal (MD) Parameters (continued) OCONV Masked Decimal (MD)
ICONV Left Justify (ML) Syntax ICONV(num.expr, "MLn [f] [ [ [prefix], [thsnd_mark], [dec_symbl], [suffix] ] ] [,] [$] [C] [Z] [(mask)]") Description The ICONV left justify (ML) function converts a decimal number to internal format after rounding, as specified by f. If the input value or conversion code is invalid, UniData returns the input value. Note: In BASICTYPE P, ICONV returns an empty string if UDT.OPTIONS 56 is on and the input value or conversion code is invalid. The ICONV MD, ML, and MR functions have the same result. They exist separately to maintain consistency with the OCONV MD, ML, and MR functions, which produce different results. Parameters The following table describes each parameter of the syntax. Parameter Description num.expr Decimal number to be converted. num.expr can be any numeric value with or without a decimal. n The ICONV function ignores n (for example, if you specify ML32, UniData ignores the 3), but it is included in the syntax to maintain consistency with the OCONV Left Justify (ML) function. ICONV Left Justify (ML) Parameters ICONV Left Justify (ML) 1-348
- Page 336 and 337: UniData SQL SELECT - For informatio
- Page 338 and 339: STATUS Function Return Values After
- Page 340 and 341: GETQUEUE Syntax GETQUEUE() Descript
- Page 342 and 343: GETREADU Syntax GETREADU() Descript
- Page 344 and 345: getResponseHeader Syntax getRespons
- Page 346 and 347: The following table describes each
- Page 348 and 349: Parameters The following table desc
- Page 350 and 351: GETUSERGROUP Syntax GETUSERGROUP(ui
- Page 352 and 353: GETUSERNAME Syntax GETUSERNAME(uid)
- Page 354 and 355: 1-316 UniBasic Commands Reference
- Page 356 and 357: Related Commands UniBasic GOSUB, ON
- Page 358 and 359: Examples In the following example,
- Page 360 and 361: Parameter Description The replace.n
- Page 362 and 363: This next example compiles and runs
- Page 364 and 365: Related Command UniBasic GTS 1-326
- Page 366 and 367: HASH Syntax HASH(rec.key,modulo,typ
- Page 368 and 369: Parameters The following table desc
- Page 370 and 371: HUSH Syntax HUSH {ON | OFF | expr}
- Page 372 and 373: ICONV Syntax ICONV(expr,conv.code.e
- Page 374 and 375: STATUS Function Return Values After
- Page 376 and 377: 1-337 UniBasic Commands Reference
- Page 378 and 379: The following table describes vario
- Page 380 and 381: Related Command UniBasic OCONV Grou
- Page 382 and 383: Example In the following example, t
- Page 384 and 385: Parameters Description Example You
- Page 388 and 389: Parameter Description Example In th
- Page 390 and 391: ICONV Packed Decimal (MP1) Syntax I
- Page 392 and 393: Parameter Description Example In th
- Page 394 and 395: Example The following table describ
- Page 396 and 397: The following table lists conversio
- Page 398 and 399: ICONV Pattern Match (P) Syntax ICON
- Page 400 and 401: Example In the following example, t
- Page 402 and 403: ICONV Text Extraction (T) Syntax IC
- Page 404 and 405: ICONV File Translation (Tfile) Synt
- Page 406 and 407: STATUS Function Return Values After
- Page 408 and 409: 1-369 UniBasic Commands Reference
- Page 410 and 411: INDEX Syntax INDEX(str.expr1,str.ex
- Page 412 and 413: INDICES Syntax INDICES(file.var[, i
- Page 414 and 415: initSecureServerSocket function Syn
- Page 416 and 417: initServerSocket Syntax initServerS
- Page 418 and 419: INMAT Syntax INMAT( ) INMAT(array.n
- Page 420 and 421: Related Commands UniBasic DIM, MAT,
- Page 422 and 423: Warning: Processing differs when yo
- Page 424 and 425: In the next example, the INPUT stat
- Page 426 and 427: Parameter Description 1-387 UniBasi
- Page 428 and 429: Related Commands UniBasic CLEARINPU
- Page 430 and 431: INPUTERR Syntax INPUTERR error.expr
- Page 432 and 433: INPUTIF Syntax INPUTIF var [THEN st
- Page 434 and 435: INPUTTRAP Syntax INPUTTRAP string.e
Parameter Description<br />
Examples<br />
In the following example, UniData converts the value 12.339 to 1234 by rounding to<br />
two decimal places and converting to internal format:<br />
1-347 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
f Scales the input value num.expr by moving the decimal point f places to the<br />
right. If omitted, f defaults to the value assigned to n (for example, if you<br />
specify MD2, UniData reads it as MD22, and then ignores the first 2).<br />
dec_symbl You can specify a symbol to represent the decimal point in the input number<br />
by including dec_symbl. An example is provided in the following section.<br />
[prefix],<br />
[thsnd_mark],<br />
[suffix]] ] [,]<br />
[$] [-| < | E |<br />
C | D] [P] [Z]<br />
[T] [(xc)]<br />
INTERNAL.VAL = ICONV("12.339","MD2")<br />
The following example demonstrates how to specify that an alternate symbol is used<br />
to represent the decimal point in the input number. This example prints 12350.<br />
PRINT ICONV("123@499","MD2[,,@]")<br />
END<br />
Related Command<br />
<strong>UniBasic</strong><br />
The ICONV function ignores these options, but they are included in the<br />
syntax to maintain consistency with the OCONV Masked Decimal (MD)<br />
function.<br />
ICONV Masked Decimal (MD) Parameters (continued)<br />
OCONV Masked Decimal (MD)