MultiValue BASIC and C# Syntax Comparison

MultiValue BASIC is excellent for developing Business and Enterprise console applications, as well as string manipulation and business rules. Many people chose to use .NET 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

C#

IF {statement} THEN
    {code}
END ELSE
    {code}
END
if ({ statement }) {
{ code };

} else {
{ code };
}
BEGIN CASE
  CASE {statement}
    {code}
  CASE {statement}
    {code}
  CASE 1
    {code}
END CASE
if ({ statement }) {
{ code };
} else if ({ statement }) {
{ code };
} else {
{ code };
}
LOOP
UNTIL {statement} DO
  {code}
REPEAT
while (!({ statement })) {
{ code };
}
LOOP
WHILE {statement} DO
  {code}
REPEAT
while ({ statement }) {
{ code };
}
LOOP
  {code}
UNTIL {statement} DO
REPEAT
do {
{ code };
} while (!({ statement }));
LOOP
  {code}
WHILE {statement} DO
REPEAT
do {
{ code };
} while ({ statement });
LOOP
  {code}
UNTIL {statement} DO
  {code}
REPEAT
do {
{ code };
if ({ statement })
break; 

{ code }; } while (true);
FOR I = {start} TO {finish} STEP {count}
  {code}
NEXT I
for (I = { start }; I <= { finish }; I += { count }) {
{ code };
}
FOR I = {start} TO {finish} UNTIL {statement}
  {code}
NEXT I
for (I = { start }; I <= { finish }; I++) {
if ({ statement })
break;

{ code }; }
VALUE = INT(5/2)
Value = Integer.Parse(5/2)
VALUE = CHAR(50)
Value = Strings.Chr(50)
RQM
Thread.Sleep(1000)
VALUE = EXP(256)
Value = Exp(256)
POS = INDEX("ABCD","A",1)
int Pos = 0;
string SearchString = "ABCD";
Pos = SearchString.IndexOf("A") + 1;

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

IF NUM(VALUE) THEN
  CRT "Number"
END
int result;
if (int.TryParse(Value, out result))
{
    Console.WriteLine("Number");
}
VALUE = OCONV("LOWER","MCL")
string _ChangeCase = "LOWER";
Value = _ChangeCase.ToLower();
VALUE = OCONV("upper","MCU")
string _ChangeCase = "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 ")
string _TrimValue = "  Trim Space  ";
Value = _TrimValue.Trim();

VALUE = STR("*",10)

Value = new string("*"[0], 10);
menu
menu