UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
OCONV Right Justify (MR) Syntax OCONV(str.expr, "MRn [f] [ [ [prefix], [thsnd_mark], [dec_symbl], [suffix] ] ] [,] [$] [C] [Z] [(mask)]") Description The OCONV right justify (MR) function scales, rounds, and formats a number, or right-justifies it in a mask. str.expr can be any valid text or a numeric value with or without a decimal. If the input value or conversion code is invalid, UniData returns the input value. Note: The OCONV ML and MR functions produce the same output. However, formatting differs slightly in the following way: if you specify a mask that is larger than the formatted number, UniData left- or right-justifies the number within a “column” the width of the mask. In BASICTYPE P, OCONV returns an empty string if UDT.OPTIONS 56 is on and the input value or conversion code is invalid. Parameters The following table describes each parameter of the syntax. 1-509 UniBasic Commands Reference
Some parameters set the same values. Results are unpredictable if you make conflicting assignments. Parameter Description str.exp Indicates a text string or number to be right-justified and formatted. n Sets precision (number of decimal places represented). It can be a number from 0 through 9. If n is less than the number of decimal points in the input data, the resulting value is rounded. f Scales the input value num.expr by moving the decimal point f places to the left. If omitted, f defaults to the value assigned to n (for example, if you specify MR2, UniData reads it as MR22). [prefix], [thsnd_mark], [dec_symbl], [suffix] The square brackets enclosing these parameters are required. prefix – Nonnumeric character(s) to precede the formatted number. For example, MR2[**] produces "**nnn...". thsnd_mark – Nonnumeric character(s) to delimit thousands. To specify a comma, enclose it in single quotation marks, and then use double quotation marks to enclose the conversion code. For example, " MR2[,',' ]" produces "...,nnn,nnn". dec_symbl – Alternate symbol to represent the decimal point. suffix – Nonnumeric character(s) to follow the formatted number. For example, MR2[, , ,**] produces "...nnn**". , Inserts commas to separate thousands. $ Precedes the formatted number with a dollar sign ($). C Specifies that a negative number is to be followed by CR, indicating a credit. Z Suppresses zeros. mask Specifies a mask to be used for formatting. Use # to represent number placement. Include special characters as desired. Results are adversely affected if the mask contradicts other parameters. For example, placement of the decimal in the mask overrides n. OCONV Right Justify (MR) Parameters If the conversion to display format is unsuccessful, UniData returns the original value. OCONV Right Justify (MR) 1-510
- Page 498 and 499: Related Commands UniBasic DIM, INMA
- Page 500 and 501: Parameter Description STATUS Functi
- Page 502 and 503: MATWRITEU Syntax MATWRITEU dim.arra
- Page 504 and 505: MAXIMUM Syntax MAXIMUM(dyn.array.va
- Page 506 and 507: MDPERFORM Syntax MDPERFORM str.expr
- Page 508 and 509: Parameter Description Examples In t
- Page 510 and 511: MINIMUM Syntax MINIMUM(dyn.array.va
- Page 512 and 513: NE Syntax expr1 NE expr2 Synonyms #
- Page 514 and 515: NEG Syntax NEG(expr) Description Th
- Page 516 and 517: NFAUSER Syntax NFAUSER(“username
- Page 518 and 519: DCOUNT INDEX LEN SEQ SWAP 1-480
- Page 520 and 521: NOTS Syntax NOTS(dyn.array) Descrip
- Page 522 and 523: NUM Syntax NUM(expr) Description Th
- Page 524 and 525: NUMS Syntax NUMS(dyn.array) Descrip
- Page 526 and 527: OCONV Syntax OCONV(expr, conv.code.
- Page 528 and 529: OCONV Date (D) Syntax OCONV(integer
- Page 530 and 531: Note: Following SMA standards, Mond
- Page 532 and 533: Related Commands UniBasic DATE, ICO
- Page 534 and 535: Related Command UniBasic ICONV Grou
- Page 536 and 537: Related Command UniBasic ICONV Leng
- Page 538 and 539: Parameter Description Examples The
- Page 540 and 541: OCONV Masked Decimal (MD) Syntax OC
- Page 542 and 543: Examples The following table descri
- Page 544 and 545: Parameter Description [ [prefix], [
- Page 546 and 547: OCONV Packed Decimal (MP) Syntax OC
- Page 550 and 551: Examples In the following statement
- Page 552 and 553: Related Commands UniBasic DATE, ICO
- Page 554 and 555: The following table indicates which
- Page 556 and 557: OCONV Pattern Match (P) Syntax OCON
- Page 558 and 559: OCONV Range (R) Syntax OCONV(num.ex
- Page 560 and 561: OCONV SOUNDEX (S) Syntax OCONV(str.
- Page 562 and 563: OCONV Text Extraction (T) Syntax OC
- Page 564 and 565: OCONV File Translation (Tfile) Synt
- Page 566 and 567: OCONVS Syntax OCONVS(dyn.array.expr
- Page 568 and 569: ON/GOSUB Syntax ON expr GOSUB label
- Page 570 and 571: Related Commands UniBasic GOSUB, GO
- Page 572 and 573: Parameters The following table desc
- Page 574 and 575: Parameter Description 1-535 UniBasi
- Page 576 and 577: openSecureSocket function Syntax op
- Page 578 and 579: OPENSEQ Syntax OPENSEQ [absolutepat
- Page 580 and 581: STATUS Function Return Values After
- Page 582 and 583: The following table describes the r
- Page 584 and 585: Example The following example illus
- Page 586 and 587: OSBREAD Syntax OSBREAD var FROM fil
- Page 588 and 589: STATUS Function Return Values After
- Page 590 and 591: Writing to Other Types of Files For
- Page 592 and 593: Related Commands UniBasic CLOSESEQ,
- Page 594 and 595: Example In the following example, t
- Page 596 and 597: STATUS Function Return Values After
OCONV Right Justify (MR)<br />
Syntax<br />
OCONV(str.expr, "MRn [f] [ [ [prefix], [thsnd_mark], [dec_symbl], [suffix] ] ] [,] [$]<br />
[C] [Z] [(mask)]")<br />
Description<br />
The OCONV right justify (MR) function scales, rounds, and formats a number, or<br />
right-justifies it in a mask. str.expr can be any valid text or a numeric value with or<br />
without a decimal. If the input value or conversion code is invalid, UniData returns<br />
the input value.<br />
Note: The OCONV ML and MR functions produce the same output. However,<br />
formatting differs slightly in the following way: if you specify a mask that is larger<br />
than the formatted number, UniData left- or right-justifies the number within a<br />
“column” the width of the mask.<br />
In BASICTYPE P, OCONV returns an empty string if UDT.OPTIONS 56 is on and the<br />
input value or conversion code is invalid.<br />
Parameters<br />
The following table describes each parameter of the syntax.<br />
1-509 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong>