473,395 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Exception Interruption Window DOES NOT APPEAR

Hi. Recently I got this problem and I don't know why.
Next simple code for example:

Expand|Select|Wrap|Line Numbers
  1. Public Sub test()
  2.  Dim VectorA() As Integer = {1, 2, 3, 4, 5, 6}
  3.  For i As Integer = 0 To VectorA.GetLength(1) - 1
  4.       (some code)      
  5.  Next
  6.  
  7.  TextBox2.Text = "GetType = " & VectorA.GetType.ToString
  8.  TextBox3.Text = VectorA.GetLength(0).ToString
  9.  (other code)
  10. End Sub
There is an exeption in "GetLength(1)" because the array just have one dimension. So, when the compiler gets there, it just ignore that and every code next to this until finish the Sub block.
If I put a Try Catch statment it works, but if not, it does not interrupt the debbuging and does not show a exception message. So, I don't know where the error is.

What I need?... I need that when I put a Try Catch statment just work, but when I donīt put the Try Catch, the debbuging stops the program and show me the Exception window.

Thanks.
Apr 16 '13 #1
15 1301
Rabbit
12,516 Expert Mod 8TB
Please use code tags when posting code.

I don't understand what your question is. There's no "error" in your syntax. VectorA.GetLength(1) will return 2.
Apr 16 '13 #2
Hi Rabbit.
There is an error: array.GetLength(1).... That "1" is the array dimension index. The first index would be index "0".
But anyway, that example is not important here.

Just imagine that there is an error in the code. When I run de application the debbuger does not stop de program and show me the exception.

If I put a Try-Catch it works, but if not, the debbuger ignores the exception and jump every line of code until finish the entire block.

Regards.
Apr 16 '13 #3
Rabbit
12,516 Expert Mod 8TB
There is an error: array.GetLength(1).... That "1" is the array dimension index. The first index would be index "0".
That's not a syntax error. Yes, the first index is 0. But there's nothing wrong with doing array.GetLength(1). Using array.GetLength(1) produces no error because there is no error in doing that.
Apr 16 '13 #4
@Rabbit
You don't understand me. Forget the code above.

The problem is that when any program produces an exception in running time, the debbuger DO NOT STOP the program and show the exception message.
Apr 16 '13 #5
Rabbit
12,516 Expert Mod 8TB
If I have to ignore the code you posted, then there's nothing I can use to diagnose your problem. Without seeing the code that's causing your issue, there's nothing I can use to tell you what's wrong.
Apr 16 '13 #6
@Rabbit
The issue is not the code, the issue is on the debuger.
Just it. When the application runs, the debuger does not stop the application when it finds an exception.
Apr 16 '13 #7
Rabbit
12,516 Expert Mod 8TB
And the problem I'm having is that I've seen no code that causes an exception.
Apr 17 '13 #8
vijay6
158 100+
And the problem I'm having is that I've seen no code that causes an exception.

Hey Rabbit, Check LeoVBNET's code again. Line number 3 have an exception ( Index was outside the bounds of the array ).

Expand|Select|Wrap|Line Numbers
  1. For i As Integer = 0 To VectorA.GetLength(1) - 1

Array 'VectorA' is a single dimensional array but LeoVBNET is trying to get the number of elements in the second dimension of array 'VectorA'.

The problem is that when any program produces an exception in running time, the debbuger DO NOT STOP the program and show the exception message.

@LeoVBNET
Your question looks like complaining that you get hit by an airbag inside your car when you met an accident.
Apr 17 '13 #9
Rabbit
12,516 Expert Mod 8TB
That's my bad, for some reason I thought you were using an array object. And I wasn't getting an error when using an array object.

One reason that the debug window may not come up is that you ran the process with debugging turned off. So the first thing you should check is whether or not that is turned off.
Apr 17 '13 #10
Ok Rabbit, but where can I set the debugging on/off?
Apr 17 '13 #11
Rabbit
12,516 Expert Mod 8TB
That depends, how are you invoking the process?
Apr 17 '13 #12
I don't know what you mean. I just open a new windows form project, introduce some code in Form1.Load event and then just debugging by press F5.
Apr 17 '13 #13
Rabbit
12,516 Expert Mod 8TB
What operating system and version of visual studio are you using?
Apr 17 '13 #14
Windows 7 Home Premium SP1
Visual Studio Ultimate 2012 v.11.0.51106.01 update 1
.NET Framework 4.5.50709
Apr 17 '13 #15
Rabbit
12,516 Expert Mod 8TB
In the debug menu, there should be an exceptions option to set what exceptions will break execution. If you don't see it in the menu, you can enable it using the instructions here: http://msdn.microsoft.com/en-us/library/d14azbfh.aspx
Apr 18 '13 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Daniel Goldman | last post by:
When I open a new popup window, with a url that includes an anchor, about 1/5 of the time the page displays correctly (jumps to anchor), 4/5 of the time page displays incorrectly (starts from...
0
by: Rafi | last post by:
hi, i have vs.net 2003 for about a month and now w/o any good reason the properties window (F4) does not appear when focusing a visual object. when focus is on a visual object (html or web...
6
by: hazz | last post by:
My runtime in debug is dropping through the constructors from an upper level class into subclassed constructors..... namespace AB public class A : MarshalByRefObject public A () ...
2
by: Vijay Kerji | last post by:
Hi: I have a child window which is opened by parent using ShowModalDialog. Child has a button called Add and its click handler at server tries to close the window as below. private void...
4
by: dik | last post by:
Hi I have a page with a button that has to open a popup window: btnPopup.Attributes.Add("onclick", "window.open("popup.aspx",null,'height=250, width=250,status= no, resizable= no,...
1
by: Frank Rizzo | last post by:
I have VS.NET 2003. For some reason the Object Browser window appears as one of the tabs for every project I open. Even if I just open VS.NET without any projects, it still appears. How can...
0
by: Bram | last post by:
Hello, I'm designing a PageControl which hosts a number of pages. I added a verb to the designer of the pages in the PageControl to select the parent control, like this: public class...
9
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" +...
5
by: wreed06 | last post by:
I have 2 problems. In my webpage, I have a dropdown list with a button that takes the user to a popup window specific to the option. I am using Firefox 2.0.0.13. I have successfully validated my HTML...
12
by: MNNovice | last post by:
I have a database in Access 2003. All of a sudden I am unable to open the property window for reports (in design view). Although the property window is visible for other objects such as, forms. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...
0
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
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...

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.