×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

use of member in expressions

use of member in expressions

use of member in expressions

(OP)
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

RE: use of member in expressions

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources