Connecting Tech Pros Worldwide Help | Site Map

Array problem when resetting after breakpoint

  #1  
Old September 2nd, 2006, 06:05 PM
Roy
Guest
 
Posts: n/a
I declared a global array which is populated on form_load. I set a
breakpoint in the code and run. I click on a control and execution
begins (and the array is accessed). The code hits the breakpoint and I
am in VBA. I hit 'reset' to stop execution. When I return to the form
and click on that control again I get the error message 'subscript out
of range' as if I had never dimesioned the array!

  #2  
Old September 2nd, 2006, 06:45 PM
RoyVidar
Guest
 
Posts: n/a

re: Array problem when resetting after breakpoint


"Roy" <royaaron1@gmail.comwrote in message
<1157217385.655546.293610@e3g2000cwe.googlegroups. com>:
Quote:
I declared a global array which is populated on form_load. I set a
breakpoint in the code and run. I click on a control and execution
begins (and the array is accessed). The code hits the breakpoint and
I am in VBA. I hit 'reset' to stop execution. When I return to the
form and click on that control again I get the error message
'subscript out of range' as if I had never dimesioned the array!
Yes, I think stopping execution by hitting reset, means you reset all
variables too.

Try continue/F5 or some of the "Step" thingies to continue and keep
your globals.

--
Roy-Vidar


  #3  
Old September 3rd, 2006, 01:15 PM
Roy
Guest
 
Posts: n/a

re: Array problem when resetting after breakpoint


Thank you. I'll learn to deal with it until MS decides to straighten
this out in the year 2050.

RoyVidar wrote:
Quote:
"Roy" <royaaron1@gmail.comwrote in message
<1157217385.655546.293610@e3g2000cwe.googlegroups. com>:
Quote:
I declared a global array which is populated on form_load. I set a
breakpoint in the code and run. I click on a control and execution
begins (and the array is accessed). The code hits the breakpoint and
I am in VBA. I hit 'reset' to stop execution. When I return to the
form and click on that control again I get the error message
'subscript out of range' as if I had never dimesioned the array!
>
Yes, I think stopping execution by hitting reset, means you reset all
variables too.
>
Try continue/F5 or some of the "Step" thingies to continue and keep
your globals.
>
--
Roy-Vidar
  #4  
Old September 3rd, 2006, 01:25 PM
Rick Brandt
Guest
 
Posts: n/a

re: Array problem when resetting after breakpoint


Roy wrote:
Quote:
Thank you. I'll learn to deal with it until MS decides to straighten
this out in the year 2050.
What is there to fix? Reset means "reset the project". Losing variable values
would be the expected result of that.

If you handle all errors properly then reset never occurs unless you want it to.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


  #5  
Old September 8th, 2006, 01:45 PM
Roy
Guest
 
Posts: n/a

re: Array problem when resetting after breakpoint


The icon is a universally accepted STOP, as has appeared as far back as
tape recorder consoles. Yes, I won't argue what "reset" should mean.
But, if all I want to do is halt execution why would I want to reset
the project so that reinvocation of the still-open form bombs out
because my initialization has been undone?


Rick Brandt wrote:
Quote:
Roy wrote:
Quote:
Thank you. I'll learn to deal with it until MS decides to straighten
this out in the year 2050.
>
What is there to fix? Reset means "reset the project". Losing variable values
would be the expected result of that.
>
If you handle all errors properly then reset never occurs unless you want it to.
>
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Closed Thread