Interpreter.ReadIncludeFile C# (CSharp) Méthode

ReadIncludeFile() public méthode

public ReadIncludeFile ( string file ) : void
file string
Résultat void
    public void ReadIncludeFile(string file) {
        if (File.Exists(file)) {
            CodeChunk.DumpingValue = false;
            using(TextReader tr = File.OpenText(file)) {
                while (ProcessLine(tr.ReadLine()))
                    ;
            }
            CodeChunk.DumpingValue = true;
        }
    }
    

Usage Example

Exemple #1
0
 public static void Main(string [] args) {
     Interpreter.Console = new TextConsole();
     Utils.Write(caption+"\n"+prompt);        
     Interpreter interp = new Interpreter();        
     string defs = args.Length > 0 ? args[0] : interp.DefaultIncludeFile();
     interp.ReadIncludeFile(defs);        
     while (interp.ProcessLine(Utils.ReadLine())) 
         Utils.Write(interp.BlockLevel > 0 ? block_prompt : prompt);
 }
All Usage Examples Of Interpreter::ReadIncludeFile