mIRC Homepage
Posted By: starbucks_mafia $squeue() and /var calculations - 25/03/04 05:09 PM
- As someone pointed out in the scripts forum, there's no way to retrieve what's been queued with /splay -q. A simple $squeue(N) returning filename would be nice.

- It's currently impossible (AFAIK) to set a local variable to a string with the format number mathematical-operator number without it being calculated. Personally I'd like to see the auto-calculation removed altogether, but seeing as it'd no doubt break a lot of scripts I'd happily settle for a switch to prevent such behaviour.
Posted By: qwerty Re: $squeue() and /var calculations - 25/03/04 06:09 PM
Are you familiar with the -n switch in /set? If you are and suggesting that there should be a /var -n too, I agree.

Btw, you may know this too, but you can do something like //var %a | set -n %a 1 + 2 | echo -a %a
/set works with the local variable %a and not with a global, just because %a was declared as local with /var earlier in the routine.
Posted By: starbucks_mafia Re: $squeue() and /var calculations - 25/03/04 07:32 PM
OK that just blew me away - it turns out I didn't know half as much about /set as I thought I did. I didn't know about the -n switch, in fact I didn't even know that /set performed the calculation in the same way that /var did. And I didn't have a clue that it operated on local variables if they're already declared. I haven't really used /set in years because I thought it only worked with global variables.

Eegads and /unset works too!
I just had a field day with //set %n global | echo -a %n | var %n | set %n local | echo -a %n | unset %n | echo -a %n

Anyway, yes, I was basically suggesting -n for /var.

In light of all this perhaps /unset should also have a switch so that it only unsets local vars if a wildcard is used.
Posted By: Narusegawa_Naru Re: $squeue() and /var calculations - 25/03/04 09:03 PM
couldnt you also do

/var %blah = $eval(1 + 2,0)

I know it works with identifiers and the like such as

var %blah = $eval($me,0)

%blah in this case is $me and not your nickname

No i guess not i just tried it and got 3 anyway. forget this post smile
Posted By: dustin Re: $squeue() and /var calculations - 26/03/04 11:12 PM
I don't know if this is in mirc.hlp or not, but I read somewhere that /var is somewhat of a shortcut to /set -l (the -l switch being 'local'). I occasionally use this for keeping the math operations from being parsed (/set -nl).
Posted By: starbucks_mafia Re: $squeue() and /var calculations - 27/03/04 01:33 AM
True, now that I know about /set's -n switch I can use that, however since the /set -l vs. /var connection and the 'local variable precedence' behaviour of /set that qwerty described are both undocumented it would still be nice to have a -n switch for /var. In fact it'd still be useful even if they were documented since /var has greater capabilities than /set (ie. multi-variable assigment) and so is preferential in most instances.
Posted By: uicn_renegade Re: $squeue() and /var calculations - 27/03/04 06:22 AM
Quote:
- As someone pointed out in the scripts forum, there's no way to retrieve what's been queued with /splay -q. A simple $squeue(N) returning filename would be nice.


$squeue
Return $true if the queue is occupied, $false otherwise.

Would be nice as well.

Posted By: uicn_renegade Re: $squeue() and /var calculations - 27/03/04 01:54 PM
Another suggestion, if possible....

have $insong return $false if a song is paused using /splay pause
Posted By: Hammer Re: $squeue() and /var calculations - 27/03/04 05:10 PM
$insong.paused perhaps, but $insong should still return $true if the song you're listening to is just paused at a particular position.
© mIRC Discussion Forums