TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: `DAVE GUYER`
date: 1997-09-05 15:51:00
subject: Re: find lines 80 char

From: "Dave Guyer" 
Perhaps more efficient at finding if there are any lines longer than
80 char, but it fails to meet my spec in that it gives no feedback 
that I can give to the programmer as to which lines fail the test.  
It would always stop at the first line found, and there would be no 
indication of other lines further down the file.
George's solution gives me a compressed view of the lines found with 
the line numbers.
> It's a good looking solution to the problem. However I think it
> might NOT be the most efficient way to do it. I believe SAL uses
> a Pascal style of string structure, i.e. the string length is 
> stored in the structure. So it should be more efficient to use
> CurrLineLen() rather than lFind(). Something like this should
> do the same job(it's longer but it might execute faster):
> 
> proc FindLong()
> 	BegFile()
> 	while (CurrLineLen() < 80)
> 		if (NOT down())
> 			warn("EOF reached, no line > 80 chars!")
> 		endif
> 	endwhile
> end
> 
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.