Re: Constructing sequences
- Posted by "Igor Kachan" <kinz at peterlink.ru> Jun 27, 2005
- 597 views
Gordon Webster wrote: [snip] > I am reading the data records in from a file so I don't see an > obvious way I could build the whole sequence at once. Wouldn't > I have to temporariliy store the records in another sequence, > incurring the same 'append' overhead anyway? [snip] Gordon, try please:
-- file aa.ex include file.e function Get_Big_File(object name) object file file = dir(name) file = file[1][3] file = repeat(0, file) name = open(name, "rb") for i=1 to length(file) do file[i] = getc(name) end for close(name) return file end function puts(1, Get_Big_File("aa.ex")) -- end of file aa.ex
Just copy/paste this code into NotePad, save it as aa.ex, and then run it from ed.ex. Good Luck! Regards, Igor Kachan kinz at peterlink.ru