Hi. Recently I got this problem and I don't know why.
Next simple code for example: - Public Sub test()
-
Dim VectorA() As Integer = {1, 2, 3, 4, 5, 6}
-
For i As Integer = 0 To VectorA.GetLength(1) - 1
-
(some code)
-
Next
-
-
TextBox2.Text = "GetType = " & VectorA.GetType.ToString
-
TextBox3.Text = VectorA.GetLength(0).ToString
-
(other code)
-
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.
15 1301
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.
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.
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.
@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.
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.
@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.
And the problem I'm having is that I've seen no code that causes an exception.
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 ). - 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.
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.
Ok Rabbit, but where can I set the debugging on/off?
That depends, how are you invoking the process?
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.
What operating system and version of visual studio are you using?
Windows 7 Home Premium SP1
Visual Studio Ultimate 2012 v.11.0.51106.01 update 1
.NET Framework 4.5.50709
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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 () ...
|
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...
|
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,...
|
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...
|
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...
|
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();" +...
|
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...
|
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.
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |