Difference between revisions of "$ifmatch"

From Scriptwiki
Jump to: navigation, search
 
m (added link to #The_Operators)
Line 10: Line 10:
  
 
== Example ==
 
== Example ==
  [[If-Then-Else|if]] ([[$me]] isin [[$read]](quotes.txt)) { [[echo]] -ag My nickname is in random quote: $v2 }
+
  [[If-Then-Else|if]] ([[$me]] [[If-Then-Else#The_Operators|isin]] [[$read]](quotes.txt)) { [[echo]] -ag My nickname is in random quote: $v2 }
 
In the above example we check if $me is in the text returned by $read.  If the comparison is sucessful $v2 is set to what ever $read returned.
 
In the above example we check if $me is in the text returned by $read.  If the comparison is sucessful $v2 is set to what ever $read returned.
  
 
[[Category:Remote Identifiers]]
 
[[Category:Remote Identifiers]]

Revision as of 23:42, 27 November 2005

Returns the first parameter of an if-then-else comparison.

$ifmatch

Note: $ifmatch is depreciated now and has been replaced by $v1 and $v2. You should switch to using $v1 and $v2 incase $ifmatch is no longer supported in future versions.

$v1 & $v2

These return the first and second parameters of an if-then-else comparison.

$v1
$v2

Example

if ($me isin $read(quotes.txt)) { echo -ag My nickname is in random quote: $v2 }

In the above example we check if $me is in the text returned by $read. If the comparison is sucessful $v2 is set to what ever $read returned.