MultiValue BASIC and VB.NET Syntax Comparison

MultiValue BASIC is excellent for developing Business and Enterprise console applications, as well as string manipulation and business rules. Many people choose C#for the GUI and UI development, whether it is ASP.NET, WinForms, or XAML. When working in these environments, it is handy to have a cheat sheet of how each language implements it syntax.

Use this cheat sheet as a starting point to understanding the similarity between syntaxes.

MultiValue BASIC

Visual Basic

IF {statement} THEN
    {code}
END ELSE
    {code}
END
If {statement} Then
    {code}
Else
    {code}
End If
BEGIN CASE
  CASE {statement}
    {code}
  CASE {statement}
    {code}
  CASE 1
    {code}
END CASE
If {statement} Then
  {code}
ElseIf {statement} Then
  {code}
Else
  {code}
End If
LOOP
UNTIL {statement} DO
  {code}
REPEAT
Do Until {statement}
  {code}
Loop
LOOP
WHILE {statement} DO
  {code}
REPEAT
Do While {statement}
  {code}
Loop
LOOP
  {code}
UNTIL {statement} DO
REPEAT
Do
  {code}
Loop Until {statement}
LOOP
  {code}
WHILE {statement} DO
REPEAT
Do
  {code}
Loop While {statement}
LOOP
  {code}
UNTIL {statement} DO
  {code}
REPEAT
Do
  {code}
If {statement} Then Exit Do
  {code}
Loop While True
FOR I = {start} TO {finish} STEP {count}
  {code}
NEXT I
For I = {start} To {finish} STEP {count}
  {code}
Next I
FOR I = {start} TO {finish} UNTIL {statement}
  {code}
NEXT I
For I = {start} To {finish}
  If {statement} then Exit For
  {code}
Next I
VALUE = INT(5/2)
Value = Integer.Parse(5/2)
VALUE = CHAR(50)
Value = Chr(50)
RQM
Thread.Sleep(1000)
VALUE = EXP(256)
Value = Exp(256)
POS = INDEX("ABCD","A",1)
Dim Pos as Integer
Dim SearchString as String = "ABCD"
Pos = SearchString.IndexOf("A") + 1

POS = INDEX("ABCD","A",3)

' You will need a program to find more than the

' first occurance of a string.

IF NUM(VALUE) THEN
  CRT "Number"
END
Dim Result as Single
If Single.TryParse(Value,Result) then
  Console.Write("Number")
End If
VALUE = OCONV("LOWER","MCL")
dim _ChangeCase as String = "LOWER"
Value = _ChangeCase.ToLower
VALUE = OCONV("upper","MCU")
dim _ChangeCase as String = "upper"
Value = _ChangeCase.ToUpper
LENGTH = LEN(VALUE)
Length = Value.Length
VALUE = STRING[3,2]
' Note: Positioning in .NET is 0 based, not1 Based like
' MultiValue BASIC
Value = String.SubString(2,2)
VALUE = TRIM(" Trim Space ")
dim _TrimValue as String = "  Trim Space  "
Value = _TrimValue.Trim()

VALUE = STR("*",10)

Value = New String("*".Chars(0),10)
menu
menu