UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Examples In the following statement, UniData moves the decimal three places to the left (0.012339), rounds to three decimal places, and then prints 0.012: PRINT OCONV("12.339","MR3") In the following statement, UniData moves the decimal two places to the left (0.12339), rounds to three decimal places, and then prints 0.123: 1-511 UniBasic Commands Reference PRINT OCONV("12.339","MR32") In the following example, UniData converts the value 123456789 to 123-45-6789 because it right-justifies it into the mask “####-##-####”: OUTPUT.VAL = OCONV("123456789","MR(####-##-####)") The following example is taken from the sample program in Appendix A, “Sample Program,” in Developing UniBasic Applications. It converts a price stored in internal format in the ORDERS file to display format, including two decimal places, commas separating thousands of dollars, and a preceding $. DISPLAY @(10,9+ENTRY):OCONV(ORDER.REC,"MR2$,"): The following statement is taken from the same sample program. This statement displays the price right-justified and formatted with commas separating thousands of dollars and a preceding $ as in $12,386.34. The right justification aligns data on the right. DISPLAY @(10,9+ENTRY):OCONV(ORDER.REC,"MR2$,"): In the following example, UniData converts the value 123456 to 1,234.56: OUTPUT.VAL = OCONV("123456","MR2$,") Related Command UniBasic ICONV Right Justify (MR)
OCONV Time (MT) Syntax OCONV(num.expr, "MT [H] [S] [c]") Description The OCONV time (MT) function converts the internal time of day from an integer between 0 and 86400 (the number of seconds in a day) to display format. Time is output in the following form: HH MM [SS] If the input value or conversion code is invalid, UniData returns the input value. Note: 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. Parameter Description num.expr Indicates a number to be converted. H Indicates that hours are to be formatted in 12-hour format with a.m. or p.m. suffixes. S Indicates that seconds are to be included in the output. c Specifies a delimiter to be placed between hours, seconds, and fractions of seconds. OCONV Time Conversion (MT) Parameters Note: A program that you can use to try out ICONV and OCONV conversion codes is provided in Developing UniBasic Applications.. OCONV Time (MT) 1-512
- 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 548 and 549: OCONV Right Justify (MR) Syntax OCO
- 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
- Page 598 and 599: Parameters The following table desc
OCONV Time (MT)<br />
Syntax<br />
OCONV(num.expr, "MT [H] [S] [c]")<br />
Description<br />
The OCONV time (MT) function converts the internal time of day from an integer<br />
between 0 and 86400 (the number of seconds in a day) to display format. Time is<br />
output in the following form:<br />
HH MM [SS]<br />
If the input value or conversion code is invalid, UniData returns the input value.<br />
Note: In BASICTYPE P, OCONV returns an empty string if UDT.OPTIONS 56 is on<br />
and the input value or conversion code is invalid.<br />
Parameters<br />
The following table describes each parameter of the syntax.<br />
Parameter Description<br />
num.expr Indicates a number to be converted.<br />
H Indicates that hours are to be formatted in 12-hour format with a.m. or p.m.<br />
suffixes.<br />
S Indicates that seconds are to be included in the output.<br />
c Specifies a delimiter to be placed between hours, seconds, and fractions of<br />
seconds.<br />
OCONV Time Conversion (MT) Parameters<br />
Note: A program that you can use to try out ICONV and OCONV conversion codes<br />
is provided in Developing <strong>UniBasic</strong> Applications..<br />
OCONV Time (MT) 1-512