TIP: Click on subject to list as thread! ANSI
echo: qedit
to: ALL
from: DBIT AS
date: 1998-03-26 07:35:00
subject: Re: Set/GetGlobalStr - speed/limit ?

From: dBit AS 
On Wed, 25 Mar 1998, Chris Antos (Exchange) wrote:
> or in the case of your customer.lst, i think it's already in an array
> format, really.  just create a temp buffer and load your customer.lst file.
> you can use lFind("10005", "^g") to find record 10005 (the ^ means the
> string must appear at the beginning of the line which in your case seems to
> be how customer.lst is formatted).  if the file is really large and is in
> sorted order, you can even write your own binary search routine to improve
> search speed.
Thanks for your suggestions!
I have used roughly the technique you describe 'for years', except for the
binary search - I just occured to me that GetGlobalStr could be used for
such tasks - if the SetGlobalStr routine was optimized for use with 
thousands of variables I think it would be a convenient way to handle
table lookups.  
but - as you suggest, what I need is a general function like the
following:
string proc GetDataFast(integer BufferId,    buffer to search
                        string  KeyStr,      search string
                        integer KeyStart,    start column for key data
                        integer KeyLen,      search key length 
                        integer DataStart,   start column for data
                        integer DataLen)     length of data to return
Lines in the SearchBuffer should be sorted ascending on KeyStart,KeyLen
Has anyone written something like that ?  Please don't tell me that
there are database packages for such things :)
- SOI -
---
---------------
* 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™.