[Implemented] Associative Arrays

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Karbon,

Are you aware of the SRod's Hash library?

http://www.purebasic.fr/english/viewtopic.php?t=24683&
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Yes, I saw it yesterday.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Code: Select all

You simple can't do this with an array, fast or slow : 

Name.s = TheSettings("name")
But why would you want to do that?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Trond,

Did you ever programmed in PHP ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Yes.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

So ?

even in PHP, you do not use them ?
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

No.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

ok - that's what i call freedom :D
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

I would also appreciate "associateive Arrays" (Hashes) as known from Perl or shown in the example code.
PB 4.30

Code: Select all

onErrorGoto(?Fred)
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

Post by naw »

I miss Associative Arrays from Unix Shell Scripting. I dunno maybe they are much slower than regular Arrays. But does it really matter?

If you need speed and sequential addressing use XXX(1) - XXX(99).
If you want descriptive names Associative Arrays rule...

For most Applications speed doesnt really matter - Most Windows servers CPUs are only 5% utilised anyhow. So you spend hours optinmising code to run on a machine that for 95% of the time has nothing to do....
Ta - N
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

An associative array can make some complicated stuff much faster by using the 'Orcache Manoeuvre'

http://use.perl.org/comments.pl?sid=33958
Post Reply