PDA

View Full Version : To the Array Masters: Letters, not numbers!


Dreppan
11-08-2005, 03:52 AM
I'm looking for a way that I can take a list of items in an array and assign them a listed value of alphabetc letters (starting at A,B,C...etc) instead of numerically. Is there an easy way to do this?

Any help would be appreciated!

Bonedaddy
11-08-2005, 04:21 AM
Closest I can think of is creating a two-variable array, or a matrix, as Maya calls it.

You could always create a second array with all the alphabet letters and rig up some translation function.

What's this for?

Dreppan
11-08-2005, 04:40 AM
Good idea -- but how to create the alphabet array? Do I have to delineate every single letter, or is there a function that automatically goes thru the alphabet?

Bonedaddy
11-08-2005, 07:11 AM
$alphabetArray[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};

Dreppan
11-09-2005, 05:44 PM
But of course -- this works like a charm, thanks!

enbee
11-10-2005, 12:30 AM
I have also just built a quick array full of letters to do this. But does anyone know if there is a way to reference a letter by using its ascii value?

CGTalk Moderation
11-10-2005, 12:30 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.