The iif() function in Visual Basic is sometimes more convenient than a full-blown if...then...else... control structure. Oddly enough, the function does not exist in VBScript.
- ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
- ' This work is licensed under the Creative Commons Attribution License. To view
- ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
- ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
- ' 94305, USA.
- ' The iif function from Visual Basic that is missing from VBScript.
- function IIf(expression, truecondition, falsecondition)
- if cbool(expression) Then
- IIf = truecondition
- IIf = falsecondition
- end if
- end function
You need to login to post a comment.