mIRC Home    About    Download    Register    News    Help

Print Thread
#43121 20/08/03 12:48 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
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


#43122 20/08/03 12:50 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/inc doesn't evaluate the first parameter I think.

#43123 20/08/03 12:56 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
it does..
//inc $(%a,0)


#43124 20/08/03 01:07 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
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..

#43125 20/08/03 01:22 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
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



#43126 20/08/03 01:59 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
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.

#43127 20/08/03 08:57 AM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
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
#43128 20/08/03 10:24 AM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: May 2003
Posts: 730
$null is exactly what i want, to make it 'nothing'

#43129 20/08/03 11:44 AM
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
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
#43130 20/08/03 01:55 PM
Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
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
#43131 20/08/03 08:12 PM
Joined: May 2003
Posts: 730
S
ScatMan Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
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.


#43132 20/08/03 10:16 PM
Joined: Feb 2003
Posts: 10
Z
Pikka bird
Offline
Pikka bird
Z
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.

Link Copied to Clipboard