Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cs.dal.ca!ug.cs.dal.ca!digdon From: digdon@ug.cs.dal.ca (Mike Digdon) Newsgroups: comp.sys.cbm Subject: Re: Reading SEQ files Message-ID: <1991Mar4.131038.27167@cs.dal.ca> Date: 4 Mar 91 13:10:38 GMT References: <13324@hubcap.clemson.edu> <1991Feb27.213545.18354@nntp-server.caltech.edu> <1991Mar02.032753.23899@ddsw1.MCS.COM> Sender: news@cs.dal.ca (USENET News) Organization: Math, Stats & CS, Dalhousie University, Halifax, NS, Canada Lines: 35 Nntp-Posting-Host: ug.cs.dal.ca In article <1991Mar02.032753.23899@ddsw1.MCS.COM> dattier@ddsw1.MCS.COM (David W. Tamkin) writes: >rknop@nntp-server.caltech.edu (Robert Andrew Knop) wrote in ><1991Feb27.213545.18354@nntp-server.caltech.edu>: > >| 10 open 1,8,1,"filename,s,r" >| 20 if st<>0 then 50 : rem this line may be wrong, somebody correct me >| 30 get#1,a$:printa$; >| 40 goto20 >| 50 close 1 > >That won't work; the print statement (to the screen) in line 30 will re-zero >st and the loop will not break when the end of the disk file is reached. >Try something like this: > >10 open1,8,1,"filename":forx=0to1:get#1,a$:x=st:printa$;:next:close1 > >The for-next loop will execute faster than an if structure with gotos; BASIC >is slow enough to need all the help it can get. > >David Tamkin Box 7002 Des Plaines IL 60018-7002 708 518 6769 312 693 0591 >dattier@ddsw1.mcs.com MCI Mail: 426-1818 CIS: 73720,1570 GEnie: D.W.TAMKIN Wnat to make that a little faster? If there is a return at the end of each line in the text file, then change the line like this: 10 open1,8,1,"filename,s,r":forx=0to1:input#1,a$:x=st:printa$:next:close1 This will print the text very fast, as (typically, a text file is 80 cols across, for printing purposes) instead of doing 80 i/o's per line, you are in essence only doing 1. Of course, if you want it any faster, ml is the way to go.. -- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + Mike Digdon: digdon@ug.cs.dal.ca + My 64 can still get the + + mike@ac.dal.ca + job at hand completed!! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+