mIRC Homepage
Posted By: Rothgar [censored] Variables? I think so. - 23/10/03 03:13 PM
Wooooooooo
I love the new variables... wait no I don't.
I spent a while helping a user. Well attempting to help a user with a variable bug...
Scenario:
//set %flood. $+ $active TRUE
Sure that works...
//say %flood. $+ $active
That doesn't...
Look forward to seeing the fix.
~Rothgar
Posted By: Raccoon Re: [censored] Variables? I think so. - 23/10/03 03:22 PM
When creating dynamic variables, you need to stitch them together.

  //set %flood. $active TRUE
Results in a variable named %flood. containing data #mirc TRUE

  //set [color:red]$+(%,flood.,$active) TRUE[/color]
Results in a variable named %flood.#mIRC containing data TRUE

Note that you need to evaluate the variable when retrieving the data from it.
  //echo -a [color:red]$($+(%,flood,$active),2)[/color]

- Raccoon
___
Edit: Noticing that you changed your example...

  //set %flood. [color:red]$+ $active TRUE[/color]
Results in a variable named %flood.#mIRC containing data TRUE
This appears to be the effect you desire.

  //say %flood. $+ $active
Results in a message > #mirc
This is *not* the effect you desire because %flood. is being evaluated before your dynamic variable is formed. The change made to /set & /var only effect the evaluation of variables in /set and /var commands. You must still use the method above for retrieving the data.

- Raccoon
Posted By: AKO Re: [censored] Variables? I think so. - 24/10/03 02:04 AM
[ %flood. [ $+ [ $active ] ] ]

also works smile

This is odd, I've never had this problem. Maybe this is something new to newer versions of mIRC? I've never had an issue with setting dynamic variables like that, but then again, I've always done it by evaluating the identifier first.
Posted By: cold Re: [censored] Variables? I think so. - 24/10/03 07:34 AM
Picky one: you only need 2 extra evaluations there, so it would be "%flood. [ $+ [ $active ] ]".
Posted By: Raccoon Re: [censored] Variables? I think so. - 24/10/03 12:44 PM
That is correct too. (well, as cold said anyway). But there isn't any problem with mIRC... everything works normally as it had.

The only change is that you *can* use /var and /set without using evaluation brackets now... but you still need evaluation brackets in order to read from them.

- Raccoon
© mIRC Discussion Forums