mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2011
Posts: 1
S
Mostly harmless
OP Offline
Mostly harmless
S
Joined: May 2011
Posts: 1
Just dabbling with oneliners to make basic channel operations quicker. I coded this:

Code:
//echo kick # $$?1="User" $$?2-="Reason?"


And it works fine. However, if I use these querybox texts:

Code:
//echo kick # $$?1="User to kick" $$?2-="Reason?"


the queryboxes are backwards (i.e., $$?2 is shown first). This seems to be affected by whether both querybox titles are multiple words; if the first has a space and/or more than one word and the second is a single word the second box will be shown first.

If I put "user to kick" and "reason to kick?" - i.e., multiple word querybox titles - they queryboxes are displayed in the correct order. When the queryboxes are displayed in the incorrect order, if I answer them appropriately then the output is in the correct order.


I'm using mIRC 7.19 (bought and paid for thank you very much ;)), why's it doing this?

TIA
Chris

Last edited by Synergist; 21/05/11 09:17 PM.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You can use the [ ] bracket to control the evaluation order of identifiers:
Code:
//echo kick # [ $$?1="User to kick" ] $$?2-="Reason?"
Any identifier within the bracket will be evaluated first.

According to mIRC FAQ:
Quote:

You can now use [ and ] evaluation brackets in aliases to control the order of evaluation of identifiers. The brackets can be uses in popups and remotes as well. Identifiers within brackets will be evaluated first, from left to right. You can also nest brackets. This allows you to evaluate things any way you like... The brackets will not show in the resulting text or command. Example's are :
/note /notice $1 " $+ [ $read [ -s + [ $2 ] ] c:\text\note.txt ] $+ "
/sayvar /say % [ $+ [ $1 ] ]

Definitions without evaluation brackets are evaluated the same way as before.


Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
Alternatively you can enclose $?="" in $() to control the evaluation order. 
I was somewhat on the right track about the $() which can be used with bracket [ ] :P


Link Copied to Clipboard