From: "Chris Antos (Exchange)"
i think a better way to do arrays is to use a buffer. use CreateTempBuffer,
and make each line be an element in the array.
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.
//chris
-----Original Message-----
From: dBit AS [mailto:dbit@sn.no]
Sent: Wednesday, March 25, 1998 3:02 AM
To: tsepro@semware.com
Subject: Set/GetGlobalStr - speed/limit ?
I have tried using the GetGlobalStr function for a kind of "associative
arrays" (like Perl).
EditFile("customer.lst") ---> 10001Customer name # 1
Repeat 10002Customer name # 2....
Key = GetText(1,5)
Data = GetText(6,30)
SetGlobalStr(Key,Data)
StopIt()
Message(CurrLine())
Until Not Down()
After about 255 (I guess) loops this slows down significantly. Is there
a smarter way to accomplish this ? How many SetGlobalStr/Int variables
can be created - are there any limit at all ??
By the way: I finally got my 2.5 .UI converted to 2.8 - ready for 3.0 :)
- SOI -
---
---------------
* Origin: apana>>>>>fidonet [sawasdi.apana.org.au] (3:800/846.13)
|