Ejemplo n.º 1
0
 private static void showErrro(string name, Energy error)
 {
     isError = true;
     Console.WriteLine("Error in file: " + name);
     if (error.getRunningStatus() != RunningState.Error)
     {
         Console.WriteLine("Unknown end status code: " + error.getRunningStatus().ToString());
         return;
     }
     
     Console.WriteLine("Message: " + error.getError().Message);
     if (error.getError().Posision != null)
     {
         Console.WriteLine("Line: " + error.getError().Posision.Line);
         Console.WriteLine("Row: " + error.getError().Posision.Row);
     }
     isError = true;
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Write you code");
            Energy e = new Energy();
            e.parse(Console.ReadLine());
            if(e.getRunningStatus() == RunningState.Error){
                ScriptError se = e.getError();
                Console.WriteLine("#Error");
                Console.WriteLine(se.Message);
                Console.WriteLine("On line [" + se.Posision.Line + "] Row [" + se.Posision.Row + "]");
            }

            Console.ReadLine();
        }