Skip to content
Jiowcl edited this page Sep 7, 2019 · 4 revisions

Welcome to the OxygenBasic.NET wiki!

Load a OxygenBasic script from file.

test_fib.txt file content.

function Fibonacci (int n) as int
  If (n = 0) then
    return 0
  end if
  
  If (n = 1) then
    return 1
  else
    return Fibonacci (n-1) + Fibonacci (n-2)
  end if
end function

print Fibonacci(10)

Program.cs file content.

string scriptPath = @"Sample\test_fib.txt";
string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8);

Oxygenbasic.O2Basic(scriptBuffer);
Oxygenbasic.Exec();

Console.ReadKey();
Clone this wiki locally