Print() public méthode

public Print ( object obj ) : void
obj object
Résultat void
Exemple #1
0
        protected bool PrintSource(Interpreter interpreter, StackFrame frame)
        {
            SourceAddress location = frame.SourceAddress;

            if (location == null)
            {
                return(false);
            }

            SourceBuffer buffer;

            if (location.SourceFile != null)
            {
                string filename = location.SourceFile.FileName;
                buffer = interpreter.SourceFileFactory.FindFile(filename);
            }
            else
            {
                buffer = location.SourceBuffer;
            }

            if ((buffer == null) || (buffer.Contents == null) || (location.Row == 0))
            {
                return(false);
            }

            string line = buffer.Contents [location.Row - 1];

            interpreter.Print(String.Format("{0,4} {1}", location.Row, line));
            return(true);
        }
Exemple #2
0
        protected bool PrintSource(Interpreter interpreter, StackFrame frame)
        {
            SourceAddress location = frame.SourceAddress;
            if (location == null)
                return false;

            SourceBuffer buffer;
            if (location.SourceFile != null) {
                string filename = location.SourceFile.FileName;
                buffer = interpreter.SourceFileFactory.FindFile (filename);
            } else
                buffer = location.SourceBuffer;

            if ((buffer == null) || (buffer.Contents == null) || (location.Row == 0))
                return false;

            string line = buffer.Contents [location.Row - 1];
            interpreter.Print (String.Format ("{0,4} {1}", location.Row, line));
            return true;
        }
 public void Print(string message)
 {
     interpreter.Print(message);
 }