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!

use of member in expressions

Status
Not open for further replies.

multicaduser

Industrial
Jan 29, 2013
261
Just ran across the function "member" in expressions and it looks like what I want but am not able to get it to work.

I have a string which is constructed from more than one input.

A list of possible true results is held in a list expression.

Trying to use the "member" function is always returning true so I'm missing something. Can someone clarify the use?

Below is from the help docs.


Synopsis

Defun: member(
Any, $item,
List, $List,
Name ( $key, Identity ),
Name ( $test, Equal ) )
@{...} Boolean;


Description:
Returns true if a given item is a member of a given list
$List may contain objects of any type; it does not have to be homogenous.

Input Arguments:
item - Specify an member item to search for
List - Specify a list of lists to search for the member item
key
test

Returns:
Boolean - True if the given item is a member of the given list


NX10.0.0.24 MP1/Windows 7 Service Pack 1
 
Replies continue below

Recommended for you

Okayyyy......got it to work, but I still don't know exactly why it works the way it does.

If the formula and variables are put into expressions like this:

MyVariable = "K"
MyList = {"A","C","D","K","Z"}

MyResult = member(MyVariable,MyList) = 1

This works.

However, there are two options that are not included in the above example and are not explained in any documentation I can find.

Does anyone know where there is documentation that explains this function more completely?

NX10.0.0.24 MP1/Windows 7 Service Pack 1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor