473,499 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Array problem when resetting after breakpoint

Roy
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!

Sep 2 '06 #1
4 1552
"Roy" <ro*******@gmail.comwrote in message
<11**********************@e3g2000cwe.googlegroups. com>:
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
Sep 2 '06 #2
Roy
Thank you. I'll learn to deal with it until MS decides to straighten
this out in the year 2050.

RoyVidar wrote:
"Roy" <ro*******@gmail.comwrote in message
<11**********************@e3g2000cwe.googlegroups. com>:
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
Sep 3 '06 #3
Roy wrote:
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
Sep 3 '06 #4
Roy
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:
Roy wrote:
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
Sep 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
328
by: Gary | last post by:
Hi How does one clear an Array? Situation is when I am executing my program everything works fine, but when I try and repeat the program without resetting my program I get this error,...
4
1508
by: F Da Costa | last post by:
Hi, Small question re the use of an Array. I'v got an array with x rowObjects in it. When i get it the type of the container is Array and i can get a hold of the objects just fine. owever,...
10
2051
by: Dennis Myrén | last post by:
Hi. I have an array of struct. My question is, if i do: STRUCT a = new STRUCT ; STRUCT s = new STRUCT(); a = s; since STRUCT is a value type, when assigning element 0 of the STRUCT array...
1
3760
by: m830266 | last post by:
I'm trying to use the APAX serial I/O control (www.turbocontrol.com/AProZilla.htm) in a VB.NET project and I'm having trouble with its 'data received' events. The data is supplied by APAX as a...
4
2240
by: Mark Gibson | last post by:
Hi, I've been playing about with array's, and found the concat operator '||' quite useful, apart from the fact that prepending an element places it in a lower subscript. Is there a way of...
4
12050
by: pauld | last post by:
$sql= sql query $i=0; while ($a2=mysql_fetch_array($a1)){array_push($temparray,$a2,$a2,$a2,$a2); { I want this array to be the value of an asssoc. array $results $results =$temparray doesnt...
27
3192
by: lovecreatesbea... | last post by:
This code snippet is an exercise on allocating two dimension array dynamically. Though this one is trivial, is it a correct one? Furthermore, when I tried to make these changes to the original...
1
349
by: fletch | last post by:
I'm trying to write a little sudoku game. When i try to set a board i use a for loop. Here it is for (int c = 0; c < 6; c++) { Random rand = new Random(); int x = rand.Next(0, 9); int y =...
2
2860
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hi, I know this will sound like a lot of hand waving, and I'll be glad to supply some sample code if necessary, but I thought something obvious might jump out at someone without doing so. ...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.