WelcomeServicesPortfolioKnowledge BaseContact Us
27 Seconds, Inc.


Knowledge base View Article

need hosting?

Need hosting? We use and love our host - CrystalTech.com!
Need hosting? We use and love our host - CrystalTech.com!

Text Disguise - CAPTCHA-image/Human Interactive Proof web services

National Holiday Dates and Bank Holiday Dates - web site that provides the dates of national and bank holidays for the United States, United Kingdom, Ireland and Scotland

Holiday Web Service - web services for programmers to provide the dates of national and bank holidays in their applications for the United States, United Kingdom, Ireland and Scotland

Our Family Heart - web site to help families communicate no matter where they are

What?! You haven't heard about the greatest remote controlled flyer to come out in years?! Checkout the FlyTech DragonFly now!

IIF Function

Summary: The IIF function is a handle little function to return a different value depending on if an expression is true or not.
 
Keywords: ACCESS
IIF
VBA
VBSCRIPT
Applicable Software: Active Server Pages (ASP)
Microsoft Access
 
Body:

For those of us how know VB and VBA, the Immediate-If function was a fantastic thing. So, here's a quick little function for VBScript that does the same thing:

Function IIF(expr, msgT, msgF)
    If expr Then
		IIF = msgT
	Else
		IIF = msgF
	End If
End Function

Now you can code:

<%=IIF( field, "Yes", "No" ) %>

This particular code was copied from an ASPMessageboard.com posting by Bill Wilkinson.

 
Author: Douglas L. Setzer, II, http://www.27seconds.com
Posted On: 3/6/2002 4:58:27 PM

Rate this article: Average: n/a
n/a12345678910
Comments?

Article Search   |   All Articles

 

 
©2002 27 Seconds, Inc. All Rights Reserved.