- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm debugging a program which is set up to reference memory locations outside the range of the dimension of various variables. Program is compiled so subscripts are not checked for range, but when I use the debugger an try to look at the variable in a watch window, I always get a 'subscript out of range' when I use a subscript that I know gives me the location of the information I want to see. Is there any way to keep the watch window from checking on the subscript of a variable?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The subscript checking that you mention is limited in scope, and probably catches obvious out-of-range subscripts, such as when you enter X(6) as a variable to watch when X is declared with a subscript range of 1:5. However, you can easily overcome this limitation by assigning a value such as 6 to a subscript variable, say, i=6, and entering X(i) as the watched variable. I enclose a screenshot to illustrate this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can also use the Memory window to display the array starting at (say) the last specified index (keeping the debugger happy), then pick the format (char, short, int (4) int (8), real(4), real(8)) and then scroll down as far as you want to go. The only disadvantage of this is addresses show up in hex. But this is a good way to check to see if something overwritten its bounds.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page