Connecting Tech Pros Worldwide Help | Site Map

Array problem when resetting after breakpoint

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 2nd, 2006, 05:05 PM
Roy
Guest
 
Posts: n/a
Default Array problem when resetting after breakpoint

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, 05:45 PM
RoyVidar
Guest
 
Posts: n/a
Default 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, 12:15 PM
Roy
Guest
 
Posts: n/a
Default 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, 12:25 PM
Rick Brandt
Guest
 
Posts: n/a
Default 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, 12:45 PM
Roy
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.