UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
Parameter Description Examples The following subroutine is taken from the sample program in Appendix A, “Sample Program,” in Developing UniBasic Applications. The subroutine converts user input to uppercase, then compares that input with Q to determine if the user is ready to quit the application. The user can enter any string starting with Q or q, or an order number. 1-499 UniBasic Commands Reference T Converts to initial cap style. First letter of each word is uppercase, and all other letters are lowercase. Space and tab are considered word separators. N Extracts all numeric characters (0-9). /N Extracts all nonnumeric characters. P Converts all nonprinting characters to tildes (~). X[D] or D Assumes input is in hexadecimal; converts to decimal. D[X] or X Converts input to hexadecimal. OCONV Masked Character (MC) Parameters (continued) GET_ORDER_NUMBER: * Have the user enter a valid key to a record in the ORDERS file. LOOP DISPLAY @(15,6): INPUT ORDER_NUMBER ORDER_NUMBER = OCONV(ORDER_NUMBER,"MCU") IF NUM(ORDER_NUMBER) OR ORDER_NUMBER[1,1] = "Q" THEN VALID_ORDER_NUMBER = 1 END ELSE VALID_ORDER_NUMBER = 0 MESSAGE = "Order # must be a Number, or the letter 'Q'" CALL DISPLAY_MESSAGE(MESSAGE) END UNTIL VALID_ORDER_NUMBER REPEAT The following statement, taken from the same sample program, extracts the numbers from user input. This use of OCONV removes the special characters the user might have entered in a formatted date. For example, the statement extracts 1234 from $12.34. NEW.PRICE = OCONV(NEW.PRICE,"MCN")
Related Commands UniBasic ALPHA, CONVERT, DOWNCASE, ICONV Masked Character (MC), NUM, UPCASE OCONV Masked Character (MC) 1-500
- Page 488 and 489: The preceding program segment produ
- Page 490 and 491: Parameter Description INMAT Functio
- Page 492 and 493: MATREADL Syntax MATREADL dim.array
- Page 494 and 495: Example In the following example, t
- Page 496 and 497: Parameters The following table desc
- 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 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 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
Parameter Description<br />
Examples<br />
The following subroutine is taken from the sample program in Appendix A, “Sample<br />
Program,” in Developing <strong>UniBasic</strong> Applications. The subroutine converts user input<br />
to uppercase, then compares that input with Q to determine if the user is ready to quit<br />
the application. The user can enter any string starting with Q or q, or an order number.<br />
1-499 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />
T Converts to initial cap style. First letter of each word is uppercase, and all<br />
other letters are lowercase. Space and tab are considered word separators.<br />
N Extracts all numeric characters (0-9).<br />
/N Extracts all nonnumeric characters.<br />
P Converts all nonprinting characters to tildes (~).<br />
X[D] or D Assumes input is in hexadecimal; converts to decimal.<br />
D[X] or X Converts input to hexadecimal.<br />
OCONV Masked Character (MC) Parameters (continued)<br />
GET_ORDER_NUMBER:<br />
* Have the user enter a valid key to a record in the ORDERS file.<br />
LOOP<br />
DISPLAY @(15,6):<br />
INPUT ORDER_NUMBER<br />
ORDER_NUMBER = OCONV(ORDER_NUMBER,"MCU")<br />
IF NUM(ORDER_NUMBER) OR ORDER_NUMBER[1,1] = "Q" THEN<br />
VALID_ORDER_NUMBER = 1<br />
END ELSE<br />
VALID_ORDER_NUMBER = 0<br />
MESSAGE = "Order # must be a Number, or the letter 'Q'"<br />
CALL DISPLAY_MESSAGE(MESSAGE)<br />
END<br />
UNTIL VALID_ORDER_NUMBER<br />
REPEAT<br />
The following statement, taken from the same sample program, extracts the numbers<br />
from user input. This use of OCONV removes the special characters the user might<br />
have entered in a formatted date. For example, the statement extracts 1234 from<br />
$12.34.<br />
NEW.PRICE = OCONV(NEW.PRICE,"MCN")