Kbase P13816: How to remove garbage characters that have been pasted into
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  1/28/2003 |
|
Status: Unverified
GOAL:
How to remove garbage characters that have been pasted into text fields
FACT(s) (Environment):
Progress 9.1x
FIX:
Use code similar to the following to replace garbage characters in a text field:
DEFINE VARIABLE cValidCharList AS CHARACTER NO-UNDO INITIAL 'ABCD'.
DEFINE VARIABLE iLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE iStart AS INTEGER NO-UNDO.
ASSIGN iStart = LENGTH(SomeTextField).
DO iLoop = iStart TO 1 BY -1:
IF INDEX(cValidCharList,SUBSTRING(SomeTextField,iLoop,1)) = 0 THEN
SUBSTRING(SomeTextField,iLoop,1) = "".
END.
MESSAGE SomeTextField VIEW-AS ALERT-BOX.