paulstreats
03-14-2003, 01:43 AM
I have put a number next to each line of script with an explanation below to help you understand what i am trying to achieve:=
-1 var a1=1
-2 var a="a"
-3 var b=1
-4 (a+b)++
-5 document.write(a1)
explanation:
-1 define var a1 to be 1
-2 define var a to be letter 'a'
-3 define var b to be number '1'
-4 combine variables 'a' and 'b' together to create 'a1' then increment it
-5 display result on screen
**i'm trying to get 'a1' to have a value of 2 rather than 1 without refering to the variable directly. I've tried this many ways but none seem to work, I keep getting the error message 'cannot assign to variable a1'
I would be grateful for any help as this would solve a few problems i have in some of my scripts. The only solution that i have right now is a great length of IF _ Else statements but a better solution would create faster flexibility.
-1 var a1=1
-2 var a="a"
-3 var b=1
-4 (a+b)++
-5 document.write(a1)
explanation:
-1 define var a1 to be 1
-2 define var a to be letter 'a'
-3 define var b to be number '1'
-4 combine variables 'a' and 'b' together to create 'a1' then increment it
-5 display result on screen
**i'm trying to get 'a1' to have a value of 2 rather than 1 without refering to the variable directly. I've tried this many ways but none seem to work, I keep getting the error message 'cannot assign to variable a1'
I would be grateful for any help as this would solve a few problems i have in some of my scripts. The only solution that i have right now is a great length of IF _ Else statements but a better solution would create faster flexibility.