error 657 -> codepage

DoDaDew

New Member
Pegers,
There are some special characters in our database and they are messing up the reports. The special characters are chr(1-31) and chr(128-255). Those special characters are in the address fields. So what I try to do is to use "substring" on each character, but I ran into the error 657, saying "increase -s option". Where is the file that contains this options? Further more, I tried to use codepage-convert to convert the unwanted ones to space, but I couldn't make the convert table inverse.
Any help is appreciated.

thanks.
 
-s (stacksize) option is passed to progress on the command line or from within a pf file.

The error 657 is probably being caused by a logic problem in your code that passes a big value to the substring starting position or length. You might be able to make use of the replace statement instead of substring.

Dont forget you might want to keep newline characters chr(10) or chr(13). Here is a function that might do the job.

Code:
function fix-string returns char (ipc_string as char):
	def var li_pos as int no-undo.
	def var li_char as int no-undo.
 
	do li_pos = 1 to length(ipc_string):
		li_char = asc(substring(ipc_string, li_pos, 1)).
 
		if (li_char < 32 and li_char <> 10 and li_char <> 13) or
			li_char > 128 then
			substring(ipc_string, li_pos, 1) = ' '.
	end.
	return ipc_string.
end.
message fix-string("Line one~rLine2") view-as alert-box.
 
Top