Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

arrays and index

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
FR
hi,
i'd like to know if there"s a way to define a string for an array index, in stead of a number, something like :

myarray["blah"]

is it possible ? Best regards,
Elise, XML learning girl X-)
 
you got it right there....arrayName["billy"] -Greg :-Q

flaga.gif
 
Yup, associative(sp?) array.

myPhnNum["bob", "tony", "burt", "ed"];

myPhnNum["bob"]="555-1234";
myPhnNum["tony"]="555-7254";
myPhnNum["burt"]="555-1933";
myPhnNum["ed"]="555-2235";

alert("Bob's phone number is " + myPhnNum["bob"]);
 
Yes, you spelled "associative" correctly. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top