Software Archive
Read-only legacy content
17061 Discussions

String error functions in Release, not in Debug

Intel_C_Intel
Employee
292 Views
I've been trying to debug a legacy DLL that uses a VB6.0 (SP4) driver. They both compile with zero errors and warnings. The Release version appears to function well, but the debugger stops at the following line of code with a string out of bounds error:

C Now look for right square bracket

K = INDEX (LINE(J:J+15), RBRACK)

RBRACK is ']' and is found in the string.

LINE is an 80 character string, but the value of J is 70, so I can see the Out of Bounds error. I was hoping there is a debugger setting that would let me ignore it, changing 15 to 10 led to other errors, as did increasing the string length.

Any comments appreciated,
dfh
0 Kudos
3 Replies
Steven_L_Intel1
Employee
292 Views
Why do you want to ignore the error? If you did (by disabling array and string bounds checking), your code would be accessing off the end of the string.

Steve
0 Kudos
Intel_C_Intel
Employee
292 Views
This section of code was developed over several years in the eighties, and hadn't previously caused problems.

I don't know compilers, and I find it odd that the CVF release version functions but not the debugger. Though probably worth mentioning, it also worked on FPS 4.0 debugger and release versions (I know, I know FPS is a poison compiler).

If it's bad programming, I'll change it, but I have tendency to introduce more errors than I solve when I'm don't write the code myself.
0 Kudos
Intel_C_Intel
Employee
292 Views
Steve, Please disregard, I just changed

K = INDEX (LINE(J:J+15),

to
K = INDEX (LINE(J:)

and it appears to have loaded all of the records. If it checks out, it's not a problem anymore.

Thanks for your time,
dfh
0 Kudos
Reply