Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Function 1

Status
Not open for further replies.

mkmech

Mechanical
Nov 12, 2004
71
I have seen this IIF function being mentioned in this forum several times. Can someone tell me what it is? I have never used it before. I couldn't find it in Help.

Thanks
 
Replies continue below

Recommended for you

The following has been pasted from Visual Basic help file...

IIf Function

Returns one of two parts, depending on the evaluation of an expression.

Syntax
IIf(expr, truepart, falsepart)
The IIf function syntax has these named arguments:
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.

Remarks

IIf always evaluates both truepart and falsepart, even though it returns only one of them. Because of this, you should watch for undesirable side effects. For example, if evaluating falsepart results in a division by zero error, an error occurs even if expr is True.


[bat]I could be the world's greatest underachiever, if I could just learn to apply myself.[bat]
-SolidWorks API VB programming help
 
Thanks TheTick. I have never used VB in SW. I am assuming this can be applied to perform certain actions in SW. Can you give me some simple example? Where can I find more detailed info on this kind of stuff/functions and their application in SW?

Thanks
 
VB can be readily applied to SolidWorks. SW macros are written/recorden in VBA (a specialized VB). You can access nearly all of VB's functionality via VB and also C++. Word has it JAVA works, too, but there is no documentation to help JAVA programmers.

The iif function is an example of some programmatic spillover from the inner workings of SW being available as an "undocumented feature".

[bat]I could be the world's greatest underachiever, if I could just learn to apply myself.[bat]
-SolidWorks API VB programming help
 
It's used in the Equation function.

Jason Capriotti
Smith & Nephew, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor