From: | Vic E Babes |
Date: | 28 Aug 99 at 17:44:32 |
Subject: | Re: Phonecode Dilemma |
----- Original Message -----
From: Dobbin <dobbin@thenet.co.uk>
To: <blitz-list@netsoc.ucd.ie>
Sent: Saturday, August 28, 1999 5:52 PM
Subject: Re: Phonecode Dilemma
> On 28-Aug-99, Bippy M wrote:
> > Hiya Guys,
> >
> > Okay I've sorta finished v1 of my phonecode proggie, and am now on v2
which
> > will have many more features :)
> >
> > Anyway, I'd like your opinions!!
> >
> > I am basically reading the phonecodes into different arrays, I setup
20,000
> > array elements in each array (I use about 10200 in each).. This
obviously
> > requires ALOT of memory, so what would be the best way arounf this..
> > basically the arrays are:
> >
> > codes$ (20000)
> > subcode$ (20000)
> > areacode$(20000)
> > display$ (20000)
> >
> > now each holds info codes holds the dialling code, and subcode holds all
the
> > little sub codes (eg 0181 (dial code) -897 (0181-897))..
> >
> > areacode$ holds the name of the area, and lastly display$ holds the info
to
> > be displayed!!
> >
> > I thought about reading codes into 1 array, and then using left$/Mid$ to
get
> > the info and compare it eg...
> >
> > suppose the following is a line from the codes.txt file:
> >
> > 0181 <20 spaces> London (greater)
> >
> > I could do a check for either
> >
> > if mid$(testline$(i),20,max_len_of_area)=inputted_area$) then
dosomething
> >
> > would this be better??
> >
> > I'll try it I think :)
> >
> > Anyway, Ideas would be appreciated :)
> >
>
> Zoinkz!
>
> Use random access files instead of arrays.
Yeah, or dynamically linked-lists. The problem with these is that you might
want to look something up by code, or by name, so I think I`d setup a
newtype as follows:
NEWTYPE .record
Code$
SubCode$
AreaCode$
Display$
NextCode.l
PrevCode.l
NextDisplay.l
PrevDisplay.l
END NEWTYPE
Then you could create a linked list, with NextCode pointing to the record
that would come (numerically) next, and the NextDisplay pointing to the
record that would come (alphabetically) next - as these would presumably be
different records. You might also have an array of 26 pointers, each of
which points to the first `A` record, `B` record, `C` record etc, and
something similar for the numbers - though you may want to extend this
further if the entries are large, to the first `An` record etc.
I`ve put off looking at DLLs in Blitz because they look complicated.
Someone on the list posted a DLL thing, I did have it archived, but when
looking for it recently, I couldn`t find it, as I`m in need of DLLs at the
moment. Could whoever it was send me a copy again privately?
Thanks,
VIC
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie