473,624 Members | 2,223 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 1559
"Roy" <ro*******@gmai l.comwrote in message
<11************ **********@e3g2 000cwe.googlegr oups.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*******@gmai l.comwrote in message
<11************ **********@e3g2 000cwe.googlegr oups.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, 'System.IndexOutOfRangeException' , does this mean I have to somewhere reset/clear my array before I can re-execute my program?.
4
1520
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, how do i get the length of the array? For container.length does not seem to work.
10
2060
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 as above,
1
3762
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 variant which appears to VB.NET as a System.Object. I want to convert this to a System.Array so that I can iterate over its elements. The VB6 usage is described at www.turbocontrol.com/TechTips/20020426.htm. If I try something similar in...
4
2256
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 either: a) prepending an element, but shifting existing elements up a subscript, so that the lower bound remains the same? eg: 1 ||> ARRAY -- new operator ||> shift array and prepend
4
12059
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 work $results =$temparray doesnt work $results =$temparray doesnt work
27
3219
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 example: for (i = 0; i < ROW + 2; ++i){ /*line 14*/ strcpy(array, "C! C!"); /*line 15*/ Apparently, the modified code wrote to the memory unit outside the allocated array, but the program ran well and there was no Segmentation
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 = rand.Next(0, 9); int r = rand.Next(1, 9);
2
2875
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. Anyway, I have a structure that has several members including an array of strings. I assign the elements of the string array from the .Text property of several TextBoxes. I then serialize the structure and write it to a file. However, when I...
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2607
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 we have to send another system
2
1485
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.