Subscribe Bookmark RSS Feed

contain func help

Amir_y

New Contributor

Joined:

Jun 11, 2017

Hi.

 

 

I try to find  member in a list ,but looks like it not works.

for example:

 

db_names = {aaa,bbb,ccc,ddd,eee};
If( Contains( db_names, db_names[3] ),
Show( "same" ),
Show( "different" )
);

 

 

 

1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

The list values are expressions, not strings, so the Contains() function needs to be handled a little differently

db_names = {aaa, bbb, ccc, ddd, eee};
If( Contains(db_names,evalexpr(db_names[3])),
	Show( "same" ),
	Show( "different" )
);
Jim