You are viewing our Forum Archives. To view or take place in current topics click here.
Basic VB.net Tutorial Thread [Start Programming Today!]
Posted:
Basic VB.net Tutorial Thread [Start Programming Today!]Posted:
Status: Offline
Joined: Feb 07, 201113Year Member
Posts: 314
Reputation Power: 14
Status: Offline
Joined: Feb 07, 201113Year Member
Posts: 314
Reputation Power: 14
First of all, you'll wanna download Visual Basic 2010 Express Edition for free or buy Visual Studio.
Download it here:
[ Register or Signin to view external links. ]
--------------------------------------------------------------------------------------------------------------------------------------
Imports
You can import .dll's when your program requires something by using the keyword 'Import'. Let's say you're making an Email sending program, you would have a line of code at the top of your source reading:
'Imports System.Net.Mail'
(For those of you who know c#, it's the same as the keywork 'using')
Picture example:
[ Register or Signin to view external links. ]
Declaring Variables and Constants
Declaring variables and constants is easy to do in Visual Basic, you will either use the keyword 'Dim' (variable) or 'Const' (constant) then the name of your variable/constant, and what it is (a string, integer, etc.). For example:
[ Register or Signin to view external links. ]
Beware when declaring variables/constants, if they're declared inside a block of code then they will be exclusive to that code (unless you use byref or byval, but that's further than this tutorial currently goes...), but if you make them outside a block of code then they're global variables/constants and can be used everywhere.
If, Else, and Elseif Statements & Message Boxes
Do, Loop
Try Statements
Try statements are very useful, if a code, for whatever reason, may provide errors then a try statement will make sure that these errors are avoided so that your program doesn't crash, then activates an alternative block of code. Basically, it works like this:
[ Register or Signin to view external links. ]
I'll be updating these tutorials when I have time, thanks for beginning to learn Visual Basic, hopefully you'll contribute something useful with it!
Download it here:
[ Register or Signin to view external links. ]
--------------------------------------------------------------------------------------------------------------------------------------
Imports
You can import .dll's when your program requires something by using the keyword 'Import'. Let's say you're making an Email sending program, you would have a line of code at the top of your source reading:
'Imports System.Net.Mail'
(For those of you who know c#, it's the same as the keywork 'using')
Picture example:
[ Register or Signin to view external links. ]
Declaring Variables and Constants
Declaring variables and constants is easy to do in Visual Basic, you will either use the keyword 'Dim' (variable) or 'Const' (constant) then the name of your variable/constant, and what it is (a string, integer, etc.). For example:
[ Register or Signin to view external links. ]
Beware when declaring variables/constants, if they're declared inside a block of code then they will be exclusive to that code (unless you use byref or byval, but that's further than this tutorial currently goes...), but if you make them outside a block of code then they're global variables/constants and can be used everywhere.
If, Else, and Elseif Statements & Message Boxes
Do, Loop
Try Statements
Try statements are very useful, if a code, for whatever reason, may provide errors then a try statement will make sure that these errors are avoided so that your program doesn't crash, then activates an alternative block of code. Basically, it works like this:
[ Register or Signin to view external links. ]
I'll be updating these tutorials when I have time, thanks for beginning to learn Visual Basic, hopefully you'll contribute something useful with it!
#2. Posted:
Status: Offline
Joined: Sep 20, 200914Year Member
Posts: 721
Reputation Power: 32
Status: Offline
Joined: Sep 20, 200914Year Member
Posts: 721
Reputation Power: 32
very nice tut, should help people get started
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Nov 27, 201112Year Member
Posts: 44
Reputation Power: 1
Status: Offline
Joined: Nov 27, 201112Year Member
Posts: 44
Reputation Power: 1
You do realise that the actual name for imports are namespaces, don't you?
- 1useful
- 2not useful
#4. Posted:
Status: Offline
Joined: Feb 07, 201113Year Member
Posts: 314
Reputation Power: 14
Status: Offline
Joined: Feb 07, 201113Year Member
Posts: 314
Reputation Power: 14
borna88 wrote very nice tut, should help people get started
Thanks for the positive feedback
- 0useful
- 0not useful
#5. Posted:
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 391
Reputation Power: 19
Status: Offline
Joined: Oct 01, 201112Year Member
Posts: 391
Reputation Power: 19
Really nice thread, You should make tuts on making a GUI or a program. That would be cool!
- 0useful
- 0not useful
#6. Posted:
Status: Offline
Joined: Apr 18, 201113Year Member
Posts: 810
Reputation Power: 41
Status: Offline
Joined: Apr 18, 201113Year Member
Posts: 810
Reputation Power: 41
Nice, I remember when you were just starting and you had that rpg game. You have come along way, good job
- 0useful
- 0not useful
#7. Posted:
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
Status: Offline
Joined: Apr 16, 201014Year Member
Posts: 4,309
Reputation Power: 179
-Birds wrote Really nice thread, You should make tuts on making a GUI or a program. That would be cool!
Not tutorials for specific things, then people can just copy and paste.
- 0useful
- 0not useful
#8. Posted:
Status: Offline
Joined: Feb 07, 201113Year Member
Posts: 314
Reputation Power: 14
Status: Offline
Joined: Feb 07, 201113Year Member
Posts: 314
Reputation Power: 14
DozenDevelopers wrote Nice, I remember when you were just starting and you had that rpg game. You have come along way, good job
Thanks haha, those were the days, I still quite like that game, despite it not having any real advanced code it in it did take a lot of repetitive crap to make it function with the shop and inventory and what-not. If nothing else, writing hundreds of lines of garbage built character
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.