Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I just read that Line Numbers can be used in VB.NET. I never even used them in VB6, but I'm curious if there's some advantage to using them, such as having the error message telling you the line # it crashed on, or something like that.
Posted
Interesting. I didn't understand the point since I thought you'd have to type them in individually, which was hardly practical. (Though I see you can do that.) So if you don't specify any, it just defaults from line 1 to X behind the scenes? Then why would you type in your own?
Posted

Cool. But I see I can type in my own numbers, such as...

 

700: Messagebox.Show("HI")

 

Which seems odd since the line number enabled after I check the option you mentioned doesn't change, but stays as it is. So what would be the point of someone doing the line I typed above?

Posted

700 isn't a line number, you are naming a code access point. For example, you could also use:

 

ShowTheMessageBox: Messagebox.Show("HI")

 

And then you could use

 

Goto ShowTheMessageBox 'or in your case Goto 700

 

and it would jump to that section.

 

 

Before modular programming, this is how you could create functions

Also, you would use the same format for error handling in Vb6-

 

These days, if you are using unconditional jump statements in high level languages, you have problems

Posted
I see. I must have misread the MSDN. I understand what label statements are. I just thought if it was a number, it meant something else. My bad.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...