|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
//inc $null %a why it doesn't work? it should evaluate $null to nothing and make it //inc %a but it gives error
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
/inc doesn't evaluate the first parameter I think.
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
Bah, lol. Maybe it simply delays evaluation then.
%a = 1 /alias %a <-- will evaluate %a to 1 and perform /alias 1 /inc %a <-- will not evaluate %a to 1 (so it doesn't try to increase 1), but will evaluate it later, so $(%a,0) becomes %a, and $null is nothing and so mIRC decides you didn't give a first parameter and echoes "insufficient parameters".
If that isn't right then I give up..
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
inc $(-u1) %a won't evaluate %a becuz it evaluate identifiers first and then /inc the variable (if it's in the right place in the command) so it's the same in //inc $null %a but doesn't work there
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
If it delayed the evaluation of all the parameters (rather than just the first) then it would still fit in. When it evaluated the first parameter to a switch it would simply take the second parameter as the variable to increase. If you give it any null value as a first parameter* it must check to see if the first parameter* or not, and if it doesn't it just says "insufficient parameters", without checking for another parameter.
*or second parameter with a switch.
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
$null is not a variable, it is an identifier, and a empty one at that. You can not manipulate the value of an identifier like you can a variable. Identifiers usually get defined by events, like $nick and $chan. $null is a pre-defined value that you can not manipulate. Try using %null instead of $null.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
$null is exactly what i want, to make it 'nothing'
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
so, you want inc $null %a, to do exactly the same as inc %a, why be so awkward :tongue:?
new username: tidy_trax
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Dude, the line "inc $null %a" had you read the helpfile for /inc would mean you want to increase the specified variable (first argument, in your case $null) with the specified value (second argument, in your case %a).
Now if you wanna make a variable have no value, then you cannot /inc it, as incc means "increment the value of" - again you could have gotten that from the helpfile -. If you wanna make a variable have no value, use /unset %varname. There is no factual difference between a variable that has no value and one that doesn't exist unless you start doing incredibly weird stuff.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2003
Posts: 730
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 730 |
u probably don't understand what i want, collective does what i want to do is to /inc %var , my question was why it doesn't work when i put $null before the %var ($null should evaluated first). the $null was just an example, it can be: inc $iif(!%a,-u4) %a here, when the $iif will return $null it won't work. i can do % $+ a at the end but i don't understand why %a doesn't work.
|
|
|
|
Joined: Feb 2003
Posts: 10
Pikka bird
|
Pikka bird
Joined: Feb 2003
Posts: 10 |
..like mentioned above: the syntax just doesnt allows to handle switches like that.. ..if you want to set the -u4timer each time you increase the var just do: $iif(!%a,inc -u4 %a) ..else, if you want the var to be set for 4 seconds and only beeing increased during the 4 seconds: $iif(!%a,set -u4 %a,inc %a) .
return is the movement of sense.
|
|
|
|
|