up previous next
open input file
OpenIFile(S: STRING): DEVICE |
***** NOT YET IMPLEMENTED *****
This function opens the file with name S for input.
Input from that file can then be read with
Get
.
(NOTE: one would normally use
source
to read CoCoA commands from a file.)
D := OpenOFile("my-test"); -- open "my-test" for output from CoCoA
Print "hello world" On D; -- print string into "mytest"
Close(D);
D := OpenIFile("my-test"); -- open "my-test" for input to CoCoA
Get(D,3); -- get the first three characters (in Ascii code)
[104, 101, 108]
-------------------------------
ascii(It); -- convert the ASCII code into characters
hel
-------------------------------
Close(D);
|