mIRC Home    About    Download    Register    News    Help

Print Thread
[censored] Variables? I think so. #56938 23/10/03 03:13 PM
Joined: Oct 2003
Posts: 8
R
Rothgar Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Oct 2003
Posts: 8
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

Last edited by Rothgar; 23/10/03 03:16 PM.
Re: [censored] Variables? I think so. #56939 23/10/03 03:22 PM
Joined: Feb 2003
Posts: 2,690
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,690
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: [censored] Variables? I think so. #56940 24/10/03 02:04 AM
Joined: Jan 2003
Posts: 119
A
AKO Offline
Vogon poet
Offline
Vogon poet
A
Joined: Jan 2003
Posts: 119
[ %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.

Re: [censored] Variables? I think so. #56941 24/10/03 07:34 AM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Picky one: you only need 2 extra evaluations there, so it would be "%flood. [ $+ [ $active ] ]".


* cold edits his posts 24/7
Re: [censored] Variables? I think so. #56942 24/10/03 12:44 PM
Joined: Feb 2003
Posts: 2,690
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,690
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


Well. At least I won lunch.
Good philosophy, see good in bad, I like!