ID:270406
Apr 20 2006, 8:41 am
|
|
can you make one varuabke my putting two variables together?
|
In response to Pyro_dragons
|
|
yes
|
In response to Mysame
|
|
when i do that i get this error
vars.dm:16:error:obj_str:undefined var vars.dm:16:error:base_str:invalid variable vars.dm:16:error:= :expected a constant expression |
In response to Scissors Man
|
|
For that we'd nee to see coooddeee..
|
In response to Mysame
|
|
mob var total_str=obj_str+str |
In response to Scissors Man
|
|
You didn't get those errors from that code.
Here's what you need to know: Variables need to be defined within the lexical scope of where they will be used. Let me demonstrate briefly what I mean: var/aardvark = 5 If you knew that already, it's good. If you learned anything, I'm glad! The lexical scope of variables was confusing to me as a new programmer, and it confuses a lot of newbies as they write their code. |
In response to PirateHead
|
|
ty every1
|
var/a=2
var/c=a+b