I have a input field called NAME and this field can be up to 30 characters. I want to get rid of preceding blanks and post blanks. If the name BROTHERS is entered I only want 'BROTHERS' not 'BROTHERS '

Then I want to scan a field name in a field CMNAME for 'BROTHERS' in a value that could be 'JONES BROTHERS '

C *IN54 DOWEQ '0'
C CUSKEY READE CUSMST 54
*
C *IN54 IFEQ '0'

C MOVE *BLANKS NEWORD1
C EVAL NEWORD1 = %Trim(NEWORD)

/FREE

pos = %scan (NEWORD1 : CMNAME);
substring=%subst (CMNAME:1:pos);
DSPLY substring;

/END-FREE
C POS IFNE 0
C WRITE ITM
C ENDIF

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.