up previous next
OpenIFile --
open input file
|
OpenIFile(S: STRING): ISTREAM |
This function opens the file with name
S for input.
Input from that file can then be read with
GetLine
.
NOTE: it is better to use
source
to read CoCoA commands from a file.
/**/ D := OpenOFile("my-test"); -- open "my-test" for output from CoCoA
/**/ Print "hello world\nhello!!!" On D; -- print string into "mytest"
/**/ Close(D);
/**/ D := OpenIFile("my-test"); -- open "my-test" for input to CoCoA
/**/ GetLine(D);
hello world
/**/ GetLine(D);
hello!!!
/**/ Close(D);
|