You could do something like below code. I was putting this text into RTF so wanted to get rid of Curly and Backslash. Another thing this does it get rid of Returns on the End. Many times uses will press enter a few times trying to tab out leaving white on the end that you don’t want.
TextAccepted PROCEDURE (*STRING TextBlock, SHORT SkipOnAcceptAll=1)
J LONG, AUTO
FoundEnd SHORT
CODE
IF SkipOnAcceptAll AND 0{PROP:AcceptAll} THEN RETURN.
LOOP J = LEN(CLIP(TextBlock)) TO 1 BY -1
IF ~FoundEnd AND TextBlock[J] <= CHR(32)
TextBlock[J] = '' !remove trailing white space 13,10,9,32
ELSE
FoundEnd = True
CASE VAL(TextBlock[J])
OF 123 ; TextBlock[J]='[' !123 OF '{{' RTF problem
OF 125 ; TextBlock[J]=']' !125 OF '}'
OF 92 ; TextBlock[J]='/' !92 '\' flip \ to / for less RTF problems
OF 13 !ok
OF 10 !ok
OF 0 TO 31 ; TextBlock[J]='' !Tabs and low ASCII to Space
OF 129 OROF 160 ; TextBlock[J]='' !a pasted 13,10 ends up as 81h or 129, 160=Hard Space
END
END !IF
END
DISPLAY
RETURN