/examples/readline.winxed

http://github.com/NotFound/winxed · Unknown · 19 lines · 18 code · 1 blank · 0 comment · 0 complexity · d8754e5b5f5dc08d7fe07716ee7ea561 MD5 · raw file

  1. function main(var args)
  2. {
  3. string filename = 'README';
  4. var file = new 'FileHandle';
  5. if (args > 1)
  6. filename= args[1];
  7. say ("File: ", filename);
  8. file.open(filename);
  9. for (;;)
  10. {
  11. var s= file.readline();
  12. if (file.eof() )
  13. break;
  14. print('>> ', s);
  15. }
  16. say("(End of file)");
  17. file.close();
  18. }