From WikiChip
Editing mirc/identifiers/$iif
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
== Parameters == | == Parameters == | ||
* '''C''' - A conditional statement that determines whether this identifier returns the $true or $false conditional. | * '''C''' - A conditional statement that determines whether this identifier returns the $true or $false conditional. | ||
− | * '''T''' - The string returned and/or identifier | + | * '''T''' - The string returned and/or identifier executed if the C statement is $true |
− | * '''F''' - Optional string returned and/or identifier | + | * '''F''' - Optional string returned and/or identifier executed if the C statement is $false |
Note: If F parameter is not used, $iif returns $null if the C statement is $false<br /> | Note: If F parameter is not used, $iif returns $null if the C statement is $false<br /> | ||
− | Note: If C evaluates to $false or $null or 0 (including 000 or 0.00), it is $false | + | Note: If C evaluates to $false or $null or 0 (including 000 or 0.00), it is $false, $true or non-zero or text strings are $true |
− | |||
== Properties == | == Properties == | ||
None | None | ||
== Example == | == Example == | ||
− | |||
− | |||
− | |||
<source lang="mIRC"> | <source lang="mIRC"> | ||
//echo -a $iif(0,$custom1(true1),$custom2(false2)) / $v1 $v2 | //echo -a $iif(0,$custom1(true1),$custom2(false2)) / $v1 $v2 | ||
− | + | = calls the custom2 identifier and returns any string returned by it. $v1 is filled with the 1st term of the C condition. | |
− | |||
− | $v1 is filled with the 1st term of the C condition. | ||
− | |||
//echo -a $iif(2 > 1,$custom1(true1),$custom2(false2)) / $v1 $v2 | //echo -a $iif(2 > 1,$custom1(true1),$custom2(false2)) / $v1 $v2 | ||
− | + | = calls the custom1 identifier and returns any string returned by it. $v1 is filled with 2 (the 1st term of the C condition) and $v2 is filled with 1 (the 2nd term of C). | |
− | + | //echo -a echo -a today: $iif($asctime($ctime,ddd) isin MonTueWedThuSat,Weekday,Weekend) | |
− | $v1 is filled with 2 (the 1st term of the C condition) and $v2 is filled with 1 (the 2nd term of C). | + | //echo -a echo -a today: $iif($asctime($ctime,ddd) isin MonTueWedThuSat,Weekday) |
− | |||
− | //echo -a today: $iif($asctime($ctime,ddd) isin | ||
− | //echo -a today: $iif($asctime($ctime,ddd) isin | ||
1st of the pair returns either Weekday or Weekend | 1st of the pair returns either Weekday or Weekend | ||
2nd of the pair returns either Weekday or $null because of the missing F parameter. | 2nd of the pair returns either Weekday or $null because of the missing F parameter. | ||
− | |||
$iif conditionals can be nested: | $iif conditionals can be nested: | ||
//echo -a Classes on the $iif($asctime($ctime,ddd) isin SatSun,Sat-Sun, $iif(T* iswm $asctime($ctime,ddd),Tue-Thur,Mon-Wed-Fri)) Schedule meet today | //echo -a Classes on the $iif($asctime($ctime,ddd) isin SatSun,Sat-Sun, $iif(T* iswm $asctime($ctime,ddd),Tue-Thur,Mon-Wed-Fri)) Schedule meet today | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == | ||
{{mIRC compatibility|5.4}} | {{mIRC compatibility|5.4}} | ||
+ | |||
== See Also == | == See Also == | ||
{{collist | {{collist | ||
Line 63: | Line 37: | ||
* {{mIRC|$true}} | * {{mIRC|$true}} | ||
* {{mIRC|$false}} | * {{mIRC|$false}} | ||
− | |||
}} | }} | ||
[[Category:mIRC identifiers|$didtok]] | [[Category:mIRC identifiers|$didtok]] |