- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to use contains() correctly?
Hi, All
I wanna use contains(),
Names Default To Here( 1 );
dt = Open( "$Sample_Data/Blood pressure.jmp" );
colNamesList = dt << get column names( continuous );
Input = New Window( "example", << modal(),
new1 = hlistbox(
Text Box( "Test name :" ),
Para_Num_teb = Text Edit Box( "", <<set width( 200 ) )
),
text box("Click OK"),
Button Box( "OK",
Para_Num = Para_Num_teb << get text();
),
);
if (!contains(colNamesList, Para_Num),
Throw("Fail ")
);
however,
Fail message occurs everytime on this script which i made.
Could you give me any advice?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use contains() correctly?
The issue you are having is that you are retrieving a character string variable from your Button Box, but your list of column names are expressions
para_num = "zippy";
colnameslist = {BP 8M, BP 12M, BP 6M, BP 8W, BP 12W, BP 6W, BP 8F, BP 12F, BP 6F};
If you just specify to have the colNamesList returned as strings, your code will work
colNamesList = dt << get column names( continuous, string );
Jim
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use contains() correctly?
The issue you are having is that you are retrieving a character string variable from your Button Box, but your list of column names are expressions
para_num = "zippy";
colnameslist = {BP 8M, BP 12M, BP 6M, BP 8W, BP 12W, BP 6W, BP 8F, BP 12F, BP 6F};
If you just specify to have the colNamesList returned as strings, your code will work
colNamesList = dt << get column names( continuous, string );
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use contains() correctly?
Thank you very much Doctor!!!