コード例 #1
0
        public void ExecTest()
        {
            string scriptPath   = @"Sample\test.txt";
            string scriptBuffer = File.ReadAllText(scriptPath, Encoding.UTF8);

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

            uint result = Oxygenbasic.Exec();

            Assert.IsTrue(result > 0);
        }
コード例 #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();
        }