do yourself a favor, setup a while loop incrementing a counter from 1 to 255. Print the chr(N) value.
after you figure out which values you want to keep, then you can setup a while loop to loop through each character in your string, only accepting the values in the ascii() range that you’re interested in.
I laugh everytime I see one of these monster replace_substr() functions.
If you really need to do it that way, create an array of your replace values, using a delimited string. Then loop through the array, using the word_ext() function. You could also increment an index to perform your replace_substr() fuction on each value (since its only 1 byte), but I like using these pseudo arrays.
something similiar I use that could be easily tweaked
$idx = 1;
$lenString = length($inputString);
while($idx <= $lenString)
begin
$chrChar = ascii(substr($inputString,$idx,1));
if($chrChar < 32 or $chrChar > 126)
begin
return('T');
end
$idx = $idx + 1;
end
return('F');
so using the same idea, you could create a new empty return string, and concatenate each qualifying character to it. Using the ascii values (to qualify), not the characters themselves. If a character doesnt fall into the numeric range, you just dont || concatenate it to the return string. my .02 
heres an example SR function for diacritics I modified from the one provided by sap.
$lstDiaSR = 'À|A,Á|A,Â|A,Ã|A,Ä|A,Å';
$idx = 1;
$SearchPair = word_ext($lstDiaSR,1,',');
$return_string = $input_string;
while($SearchPair is not null)
begin
$return_string = replace_substr($return_string,word_ext($SearchPair,1,'|'),word_ext($SearchPair,2,'|'));
$idx = $idx + 1;
$SearchPair = word_ext($lstDiaSR,$idx,',');
end
return($return_string);
gives an example on how to create a 2dimensional array using a string and word_ext. I truncated the list of diacritics since it was fairly large.
jlynn73
(BOB member since 2009-10-27)