I have a code snippet below (as suggested in a previous answer on stack overflow ... Removing all special characters from a 4GL string ) which is trying to remove all extended characters from a string so that I can pass it to a client system that won't accept any extended characters.
do v-int = 128 to 255:
assign v-string = replace(v-string,chr(v-int),"").
end.
It works great with one exception (which makes me afraid that there may be others that I did not catch). When it reaches 255, it will replace all the "y" in the string.
If I do the following ...
display chr (255) = chr (121) ./* 121 - age code y * /
I believe in the result.
And so if I do the following ...
display replace ( " ", chr (255), "").
:
, 'y' , :
def var v-string char init "abcdefghijklmnopqrstuvwxyz". def var v-int int.
do v-int = 128 255:
v-string = replace (v-string, chr (v-int), "").
.
v-.
:
, , 255 , , .
- ?
!