My guess is that after the subscript is decremented to 0 and it leaves the loop it is being referenced again and the 0 subscript is causing the error.
Do you have Net Express installed on the computer on which this error is occurring?
If you do then I would recommend that you animate the program and place a breakpoint in the problem area so that you can check what the code is doing by single-stepping thru it.
If you do not have Net Express installed on this computer then I would recommend producing a core dump when the error occurs and then animating the cblcore file that is produced on a computer on which Net Express is installed and to which you have access to the source and .idy file.
You can create a core dump by executing the command cblcored prior to the execution of your program that is causing the 153 error. cblcored.exe can be found in the bin folder of the Server 5.1 product. It will ask you to select a method to use and select enable with prompt.
When the 153 error occurs it will then generate the file named cblcore into the current directory of the process.
Copy cblcore over to your development computer and in the Net Express IDE select animate and then browse to the cblcore file and select it. It will need access to your .idy file for debugging information.
This will then display your program source and the line on which the error occurred will be highlighted and you can check the contents of the programs variables.
Thanks.