// ************************************************************************************************ // AnyScript Sample // Opens the "Test.txt" file and outputs it to the screen // Created: 2007-01-19 // Last Modified: 2007-01-19 // by Mark Ormston // ************************************************************************************************ ProcInt Main() { UProcInt filepnt; String currentline; // Check if the file exists If (!System.FileExists("Test.txt")) { Print("Unable to locate the Test.txt file."); Return 0; } // Attempt to open the file If (!(filepnt = System.FileOpen("Test.txt", SYSTEM_FILEOPEN_READ))) { Print("Unable to open the Test.txt file."); Return 0; } // Read through the file and output the data While (!System.FileEOF(filepnt)) { // Read in a line currentline = System.FileReadLine(filepnt); // Print it to the screen // Use flags, bit 0, which means to try to line wrap cleanly Print(currentline + "\n", 0x01); } // Close the file System.FileClose(filepnt); } // Main