1. Restore
- Posted by "Wallace B. Riley" <wryly at MINDSPRING.COM> Aug 28, 1997
- 569 views
Euphoria apparently has no command corresponding to 'restore' in BASIC. Without it, I have to open a file inside a subroutine, say 'get', 'get', 'get', ... in a loop until I find what I am looking for in the file, then close the file. Next time I enter the subroutine, I open the file again and start over. This seems inefficient. I'd rather open the file once outside the subroutine, leave it open, and start at the beginning of the file whenever I enter the subroutine. But without the pseudo-'restore' command, the next time around I begin looking in the file where I left off before. Have I overlooked something? Wally Riley wryly at mindspring.com
2. Re: Restore
- Posted by Michael Bolin <michaeltom at GEOCITIES.COM> Aug 28, 1997
- 554 views
- Last edited Aug 29, 1997
> Euphoria apparently has no command corresponding to 'restore' in BASIC. > Without it, I have to open a file inside a subroutine, say 'get', 'get', > 'get', ... in a loop until I find what I am looking for in the file, then > close the file. Next time I enter the subroutine, I open the file again and > start over. > > This seems inefficient. I'd rather open the file once outside the > subroutine, leave it open, and start at the beginning of the file whenever I > enter the subroutine. But without the pseudo-'restore' command, the next > time around I begin looking in the file where I left off before. Read up on the seek() command in the manual. Michael Bolin
3. Re: Restore
- Posted by Daniel Berstein <danielberstein at USA.NET> Aug 30, 1997
- 581 views
> This seems inefficient. I'd rather open the file once outside the > subroutine, leave it open, and start at the beginning of the file whenever I > enter the subroutine. But without the pseudo-'restore' command, the next > time around I begin looking in the file where I left off before. Use the "seek()" function. If you want to 'resume' the last positon you accesed in the file, you can store 'where()' in a variable and then 'seek()' to it. Regards, Daniel Berstein danielberstein at usa.net http://www.geocities.com/SiliconValley/Heights/9316