Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!amdcad!amdahl!netcom!avery From: avery@netcom.UUCP (Avery Colter) Newsgroups: comp.lang.c Subject: Re: MORE/PAGING routine needed ... Message-ID: <17292@netcom.UUCP> Date: 22 Nov 90 09:49:46 GMT References: <1244@eci.UUCP> <14420@smoke.brl.mil> <1990Nov12.111335.22772@diku.dk> Organization: Netcom- The Bay Area's Public Access Unix System {408 241-9760 guest} Lines: 18 Well, the regular expression search thingie I'm trying to hack is turning out to be a good sized dragon, so I will shortly beam up what I have so far for a paging routine. If you want to do it sooner, it basically goes through a for loop a number of times equal to the number of lines per hit you want. The I just give it an fgets and an fputs inside the loop, returning if the end of the file is found. When the loop ends, put in whatever input routine you want to use. What I have currently is a gets, partly because my system doesn't have a curses header file or getch or getche. If you can put in some event-driven loop to test for a keyboard stroke, it'll perform more like the Unix shell command. -- Avery Ray Colter {apple|claris}!netcom!avery {decwrl|mips|sgi}!btr!elfcat (415) 839-4567 "I feel love has got to come on and I want it: Something big and lovely!" - The B-52s, "Channel Z"