28 th Jun 2022 22:18:23
Hai Friend , Sign In
Home
World
INDIA
Chennai City
Games
Developers
Members
Birthday
Search
Astrology
G. K.
Story
Tamil Nadu Government Holiday List 2018 in English and Tamil   *   Trichy: Wanted - PHP, MySql Programmers. Contact trichy people only 84894 28 444.   *   Indian Railways New Train Number List [Search / Enquiry / Locator / Finder]   *   பன்றிக் காய்ச்சல் பற்றி அறிந்து கொள்ளுங்கள் (Swine Flu H1N1)
See Also
Choose Function Choose Function
Switch Function Switch Function
If...Then...else Statement If...then...else Statement
Select...Case Statement Select...Case Statment
Type Conversion Functions Type Conv. Functions
Visual Basic Functions Visual Basic Functions
Visual Basic Home Visual Basic Home
 
Description  Syntax  Return Datatype  Example  Migration

IIf Function - Visual Basic 6.0 (VB 6.0)

Returns one of two parts, depending on the evaluation of an expression.
Syntax:
IIf(expr, truepart, falsepart)
Parameter Description
expr Required. Expression you want to evaluate.
truepart Required. Value or expression returned if expr is True.
falsepart Required. Value or expression returned if expr is False.

Return Data type:
Variant
Example:


Dim a as Integer, b as Integer
a = 5
b = 10

Statement Result Remark
IIf(a > b, "a is Big","b is Big") a is Big  
IIf(a = b, "a is equal to b", "a is not equal to b") a is not equal to b  
IIf(b > a, b, a) 10 value of b
IIf("abcd", 2, 2) bc  
IIf(True, "TRUE PART", "FALSE PART") TRUE PART  
IIf(False, "TRUE PART", "FALSE PART") FALSE PART  
Go to top

Migration from Visual Basic 6.0 (VB 6.0) to
  IIf Function in VB Script (VBS)
  IIf Function in JScript (JS)
  IIf Function in ASP (Active Server Page)
  IIf Function in PHP Script
  IIf Function in MS-Access
  IIf Function in MS SQL Server
  IIf Function in Oracle
  IIf Function in C Language
  IIf Function in C++ Language
  IIf Function in Foxpro
  IIf Function in Fortran
  IIf Function in MS Excel Sheet
Go to top
 





© 2021 Chennaiiq.com. All Rights Reserved.

5281