Once user enters a data for eg abc$sdfgh% I want to remove the illegal characters from this text.Could someone please suggest me how this can be achieved in eWam?
If you have access to the wyde framework you should option 1. if not please read options 2. and 3.
WFTypes.RemoveSpaceAndSpecialCharFrom(thisCString)
function RemoveSpaceAndSpecialCharFrom(thisCString : CString) return CString
_Result = WFTypes.RemoveSpaceAndSpecialCharFrom(thisCString)
endFunc
Build your own method something like this:
function RemoveSpecialCharFrom(thisCString : CString) return CString
var pCurChar : .Char
_Result = thisCString
forEach pCurChar in _Result
switch pCurChar.
when 'â', 'à'
pCurChar. = 'a'
endWhen
when 'é', 'ê', 'è'
pCurChar. = 'e'
endWhen
when 'î', 'ì'
pCurChar. = 'i'
endWhen
when 'ô', 'ò'
pCurChar. = 'o'
endWhen
when 'ù', 'û'
pCurChar. = 'u'
endWhen
when 'ç'
pCurChar. = 'c'
endWhen
when 'À', 'Â'
pCurChar. = 'A'
endWhen
when 'È', 'É', 'Ê'
pCurChar. = 'E'
endWhen
when 'Î', 'Ï', 'Ì'
pCurChar. = 'I'
endWhen
when 'Ç'
pCurChar. = 'C'
endWhen
when 'Ô', 'Ò'
pCurChar. = 'O'
endWhen
when 'Ù', 'Û'
pCurChar. = 'U'
endWhen
when '/', '\', '(', ')', '.', ',', ';', ':', '?', '-', '&', '$', '[', ']',
'''', '"', '=', '+', '~', '`', '^', '@', '{', '}', '!', '<', '>', '²',
'£', '¤', '%', '°'
pCurChar. = '_'
endWhen
endSwitch
endFor
endFunc