Difference between revisions of "Visual Basic: Syntax"

From Mario Fan Games Galaxy Wiki
Line 9: Line 9:
  
 
==IF Statements==
 
==IF Statements==
Yada yada yada
+
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
 
dooby = dooble
 
dooby = dooble
Line 17: Line 17:
 
doobledooby = true
 
doobledooby = true
 
End if</source>
 
End if</source>
blah blah blah
 
  
==Case==
+
==Case Statements==
<source lang="vb">Select Case YOMAMMA
+
Case statements are very similar to If Statements but they are much easier to read.
Case 2352
+
<source lang="vb">Select Case POWERUP
YOMAMMA = false
+
Case 0
Case 63251
+
CANSHOOT = false
YOMAMMA = true
+
Case 1
Case else
+
CANSHOOT = true
YOMAMMA = YODADDA
 
 
End select</source>
 
End select</source>
 
and you get the message
 
 
 
and then there would be a box here with more meaningful tutorials listed in it
 
  
 
[[Category:Visual Basic]]
 
[[Category:Visual Basic]]

Revision as of 00:02, 14 January 2015

(This is currently more of a test to see whether or not these sorts of pages are worth making)

 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