• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Anyone know VB.NET?

Status
Not open for further replies.

Soul4ger

Member
Didn't want to, but required to take a computer class. Stuck on this damn project on doing. If anyone would be kind enough to answer a couple basic, beginner's questions, a response here or a PM would be most appreciated.
 

RevenantKioku

PEINS PEINS PEINS PEINS PEINS PEINS PEINS PEINS PEINS PEINS PEINS PEINS oh god i am drowning in them
How basic?
Actually, I haven't used vb.net, I just used to rock vb5, so I don't know if there have been too many changes or not.
 

Soul4ger

Member
First question:

1) What do Option Explicit and Option Strict do? Option strict requires type-casting, right, like you can assign a Double value to an Integer variable, or a String to an Integer, etc.? But what about Option Explicit?

2) If you're writing a project, and you have to convert feet and inches to meters and centimeters, where in the code would you assign the variables for that? Does it matter, or do you have to do it on the textboxes where that data is received, or do you do it in the area relating to the button where the data is calculated?

I might have additional ones, but that's all I can come up with right now...

OH!

And:

3) How do you clear labels in code?
 

Kefkaff

Banned
I forget what Option Explicit does, just leave it on. :p

2) Forget

3) lblName.Text = ""



yea, I suck at programming
 
1. option explicit specifies that you MUST declare all the variables you are going to use, rather than relying on implicit declaration.

2. Perform the conversion in the event handler for the button that performs the conversion action. Bind the event handler to the button's "Click" event and stick the conversion code inside the event handler method.
 

Soul4ger

Member
Drinky Crow said:
1. option explicit specifies that you MUST declare all the variables you are going to use, rather than relying on implicit declaration.

2. Perform the conversion in the event handler for the button that performs the conversion action. Bind the event handler to the button's "Click" event and stick the conversion code inside the event handler method.

You're awesome, sir. Thanks much.
 

Lhadatt

Member
Drinky Crow said:
2. Perform the conversion in the event handler for the button that performs the conversion action. Bind the event handler to the button's "Click" event and stick the conversion code inside the event handler method.
That's #1 of the 2 most logical choices.

#2 would be to make a separate function and call that in the button.Click event.
 
Status
Not open for further replies.
Top Bottom