Hi Bruce,
In my NT web applications, I added a message hook procedure to handle any messages that clarion can throw in server application. If an "Index out of range" error message is triggered then message hook procedure forces the application to GPF. (peek into address 0). This forces the GPF Reporter to dump the procedure stack where I am able to isolate the code that caused the "Index out of range" error.
At a customer site an "Index out of range" error was reported. The GPF reporter dump revealed that error occurred in NetWeb.clw at line 11518. This is in the NetWebServerWorker.UTFToAscii method at a following line:
if utfmap[utf] > 0
The line before is
if utf <= maximum(utfmap,1)
so variable "utf" must be zero or less to cause the Index out of Range error. I modified the range change code (see green text) to check for values below the range of the array.
if utf <= maximum(utfmap,1) and utf > 0
if utfmap[utf] > 0
…..
else
returnValue[y] = chr(255) ! probably means the utfmap needs to be expanded
end
Thus if variable "utf" is zero or less, the character is handled as if it was not a valid character.
I cannot duplicate the error but it has happened twice at a customer site. I do not know how the customer is managing to get a null into the variable. But they have a number of international users, I suspect it is the entry of some special character. Please consider adding a similar range check on this index variable to the array in a future NT release.
Thanks,
Rob Kolanko