IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB.Net
Search VB.Net Group:

Advanced
-Collapse +Expand VB.Net To/From
To/FromCODEGuides
-Collapse +Expand VB.Net Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► KBProgrammingVB.NetTool Basics   Print This     
  From the August 2009 Issue of Prestwood eMag
 
VB.Net Tool Basics:
VB.Net Variables (Dim x As Integer=0)
 
Posted 13 years ago on 11/7/2008 and updated 1/16/2009
VB.Net Code Snippet:
 A flashcard from our VB.Net Flashcards Library
 A code snippet from our VB.Net Code Snippets Page
 Tags: VB.Net , Variables

KB101570

Languages Focus: Variables

A variable holds a value that you can use and change throughout your code so long as the variable is within scope. With variable declaration, you not only want to know the syntax of how you declare a variable but you also want to know where. Are you allowed to declare a variable inline? What are the available scopes: local vs. global. Can you assign a value at the same time you declare a variable?

VB.Net Variables

Variables are case sensitive but VS.Net will auto-fix your variable names to the defined case. You can declare variables in-line wherever you need them and declarative variable assignment is supported.

Syntax Example:

Dim FullName As String

Dim Age As Integer

Dim Weight As Double

FullName = "Mike Prestwood"

Age = 32

Weight = 154.4

'Declaritive variable assignment:

Dim Married As String = "Y"

MsgBox(Married)


Comments

1 Comments.
Share a thought or comment...
Comment 1 of 1

Our science teacher loves tests just as much as he fails at creating them. I feel like an underpaid detective when trying to unravel what exactly is being asked in a question. Now that I delegated this task to essay writing service I feel much happier. Sometimes they don‘t get it all right too, but generally, my grades are good.

Posted 20 months ago
 
Write a Comment...
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1182A1
Enter key:
Code Contributed By Mike Prestwood:

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Visit Profile


Linked Certification Question(s)

The following are practice certification questions with answers highlighted. These questions were prepared by Mike Prestwood and are intended to stress an important aspect of this KB post. All our practice questions are intended to prepare you generally for passing any certification test as well as prepare you for professional work.

Beginner

1 Beginner Level Question

Question #1: Multiple Choice

The correct syntax for a declaritive variable assignment is?

Answer:
1. 
Dim Married As String = "N"
2. 
Dim Married As String := "N"
3. 
Dim Married As String == "N"
4. 
Dim Married As String, Married = "N"
5. 

None of the above.


 KB Article #101570 Counter
10184
Since 11/7/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]