TRIM ( expression , trim-chars )An expression (a constant, field name, variable name, or expression) whose value is a CHARACTER or LONGCHAR. If expression is a case-sensitive variable, the AVM performs a case-sensitive trim. If expression is a LONGCHAR, the result is in the same code page.A character expression that specifies the characters to trim from expression. If you do not specify trim-chars, the TRIM function removes spaces, tabs, line feeds, and carriage returns.
DEFINE VARIABLE menu AS CHARACTER NO-UNDO EXTENT 3.DO WHILE TRUE:DISPLAY" 1. Display Customer Data" @ menu[1] SKIP" 2. Order Data" @ menu[2] SKIP" 3. Exit" @ menu[3] SkIPWITH FRAME choices NO-LABELS.CHOOSE FIELD menu AUTO-RETURN WITH FRAME choicesTITLE "Demonstration Menu" CENTERED ROW 10.HIDE FRAME choices.IF TRIM(FRAME-VALUE) BEGINS "1" THEN RUN r-dblnkc.p.IF TRIM(FRAME-VALUE) BEGINS "2" THEN RUN r-dblnko.pIF TRIM(FRAME-VALUE) BEGINS "3" THEN LEAVE.END.
The TRIM function is double-byte enabled. The specified expression and trim-chars arguments can contain double-byte characters. TRIM does not remove double-byte space characters by default.
If expression is a case-sensitive field or variable, then trim-chars is also case sensitive. Otherwise, trim-chars is not case sensitive.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |