if var/p="Blue"
and I put
if(usr.p>=1)
and there is a var called usr.Blue
would it be called as usr.Blue? for some reason I'm spacing and it seems right but I think I remember it isn't. Just trying to remember... and is there another way to do this?
ID:266760
Jun 16 2002, 7:28 pm
|
|
Jon Snow wrote:
if var/p="Blue" Nope. It'd be usr.p, which is "Blue", so your if() would be if("Blue">1), which is a type mismatch and will produce a runtime error. What you're looking for is this:
if(usr.vars[usr.p]>1)
Lummox JR |
In response to Lummox JR
|
|
thanks a ton !!! I needed a shortcut and this'll work just fine ... :)
hmm one last quick question... what if I wanted it to be equal to another var, but also when the var changes it automatically changes with it, is it possible? like literally a var is almost an exact duplicate of another... var/p="[selection]" maybe? except for the fact one is used for certain things and the other is used for another thing.. (it's hard to explain why I need this) |
In response to Jon Snow
|
|
Jon Snow wrote:
thanks a ton !!! I needed a shortcut and this'll work just fine ... :) Once you set p this way, it's a static string that won't change. except for the fact one is used for certain things and the other is used for another thing.. (it's hard to explain why I need this) I really don't follow what you're trying to do here. It sounds like you want a pointer or reference, but don't. Is it some kind of adaptive formula you're after, perhaps? Like if var/n gets changed, var/m (which is n*n) changes appropriately? If this is the case, I'm afraid what you'll have to do is use a proc to make the changes. Lummox JR |
In response to Lummox JR
|
|
you hit it right on the nogin! :) I'm bad at explaining things but you're right... I'm going to have to make procs, I was just hoping for a quicker way around this...
|
Do what? ... :-)
Reference a variable using another variable's value? No, I don't think so, unless you use lists. (Look it up in the docs! :) )