Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: open

Message Too Old, No Replies

Combinding variables.

How would I make var B and var A into one variable?

     

MartinWeb

12:58 am on Sep 6, 2008 (gmt 0)

5+ Year Member



Lets say I wanted to make variable Bob and variable Joe into one variable, so if Bob=1, and Joe=2, the variable would be 3. Then, with that new variable that holds 3, how could I add B in front of it so it looked like B3?

Bob=1
Joe=2
New variable= B3

Thanks!
:)

corgan1003

3:29 pm on Sep 9, 2008 (gmt 0)

5+ Year Member



Something like:

var temp:Number = Bob + Joe;
String new_var = temp as String;
new_var = "B" + temp;

...haven't tested it but this should work or show you the right direction

corgan1003

3:30 pm on Sep 9, 2008 (gmt 0)

5+ Year Member



for the last line, i meant:

new_var = "B" + new_var;

 

Featured Threads

Hot Threads This Week

Hot Threads This Month