public void ErrorTest()
        {
            string scriptPath   = @"Sample\test.txt";
            string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8);

            Oxygenbasic.O2Basic(scriptBuffer);
            Oxygenbasic.Mode((int)Enums.Mode.Asciiz);

            string result = null;

            if (Oxygenbasic.Errno() != 0)
            {
                result = Oxygenbasic.Error();
            }

            Assert.IsNull(result);
        }
Beispiel #2
0
        /// <summary>
        /// Main
        /// </summary>
        /// <param name="args"></param>
        /// <returns>Returns void.</returns>
        static void Main(string[] args)
        {
            string scriptPath   = @"Sample\test_fib.txt";
            string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8);

            Console.WriteLine("O2 Version:" + Oxygenbasic.Version());

            Oxygenbasic.O2Basic(scriptBuffer);
            Oxygenbasic.Mode((int)Enums.Mode.Asciiz);

            if (Oxygenbasic.Errno() == 0)
            {
                Oxygenbasic.Exec();
            }
            else
            {
                Console.WriteLine("Error: " + Oxygenbasic.Error());
            }

            Console.ReadKey();
        }