up previous next
OpenIFile    --    open input file


Syntax
OpenIFile(S: STRING): ISTREAM

Description
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.

Example
/**/  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);

See Also