Visual Basic: Syntax

From Mario Fan Games Galaxy Wiki
 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