Difference between revisions of "Visual Basic: Syntax"

From Mario Fan Games Galaxy Wiki
m
 
Line 1: Line 1:
''(This is currently more of a test to see whether or not these sorts of pages are worth making)''
 
 
{{needsattention}}
 
{{needsattention}}
 
This is a list of common syntax elements in the [[Visual Basic]] programming language.
 
This is a list of common syntax elements in the [[Visual Basic]] programming language.
Line 8: Line 7:
 
As with most programming languages, comments are ignored by the Visual Basic interpreter and therefore don't effect the code in any way. They simply exist to help other programmers understand the code better.
 
As with most programming languages, comments are ignored by the Visual Basic interpreter and therefore don't effect the code in any way. They simply exist to help other programmers understand the code better.
  
==IF Statements==
+
==If Statements==
 
If is a statement, which is common across many programming languages. An If statement in Visual Basic looks like this:
 
If is a statement, which is common across many programming languages. An If statement in Visual Basic looks like this:
 
<source lang="vb">If something = something then
 
<source lang="vb">If something = something then

Latest revision as of 00:04, 14 January 2015

 Stub.png This article or section is in need of expansion.

Please add further information.

This is a list of common syntax elements in the Visual Basic programming language.

Comments

Comments in Visual Basic are made by placing an apostrophe ( ' ) at the beggining of a line.

'this is a comment in VB

As with most programming languages, comments are ignored by the Visual Basic interpreter and therefore don't effect the code in any way. They simply exist to help other programmers understand the code better.

If Statements

If is a statement, which is common across many programming languages. An If statement in Visual Basic looks like this:

If something = something then
dooby = dooble
Elseif somethingelse = something then
dooble = dooby
Else
doobledooby = true
End if

Case Statements

Case statements are very similar to If Statements but they are much easier to read.

Select Case POWERUP
Case 0
CANSHOOT = false
Case 1
CANSHOOT = true
End select