DataBasic Reference > Statements and Intrinsic Functions > I > IFS Function

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

IFS Function (DataBasic) (m618703+ifs_f.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

IFS Function

Selects elements from two dynamic arrays, depending on the logical values of elements in a third array.

Syntax

IFS(dynArray, trueArray, falseArray)

Syntax Elements

dynArray, trueArray, falseArray
DataBasic expressions that evaluate to dynamic arrays.

Return Value

A dynamic array with the same structure as dynArray, formed by combining elements from trueArray and falseArray. Each element in the new array contains the corresponding element from either trueArray or falseArray, depending on the logical (true or false) value of that element in dynArray. If there is no corresponding element in trueArray or falseArray (as appropriate), the element concerned is set to null.

Comments

For details of the logical values of different types of element, refer to Logical Expressions.

Missing elements (those that appear in one array, but not in the other) are treated as null.

Example

ARY = @TRUE:@VM:@FALSE
TARY = "John":@VM:"Paul"
FARY = "George":@VM:"Ringo"
NEWARY = IFS(ARY, TARY, FARY)

Sets NEWARY to "JohnVMRingo".

RealityV15.1 (MoTW) Revision 7Comment on this topic