Difference between revisions of "$*"

From Scriptwiki
Jump to: navigation, search
m
 
m (Typo)
Line 1: Line 1:
$* is a hidden shortcut to "looping" [[tokenize|tokenized]] ([[$1-|$N]]) dat
+
$* is a hidden shortcut to "looping" [[tokenize|tokenized]] ([[$1-|$N]]) data
  
 
  $*
 
  $*

Revision as of 19:29, 31 July 2009

$* is a hidden shortcut to "looping" tokenized ($N) data

$*
  • $* only works in one command per tokenization
  • $* is very quirky, and should not be used in most cases. Instead, While loops should be employed.

Notes

When using $*, mIRC replaces it with "`~$*" and passes it to all identifiers used. Once it is done, and all identifers have returned, and the command is ready to be executed, mIRC loops and does the command $0 times replacing EVERY instance of "`~$*" with one of the tokens.

Examples

(Assume $1 = a, $2 = b, $3 = c)

; Echos "a" then "b" then "c"
echo -a $*
; Echos `. Remember, "`~$*" is ONLY replaced once it is back in the command. You cannot pass it to an identifier, or "`~$*" is used.
echo -a $left($*,1)

See Also