Dear All,
Let me ask a question regarding Text Edit Box() function
Goal
Copy and Paste Excel values (Certain SerialNumber) into text edit box and sort the Panel box (inserted SerialNumber)
I created some script referring to examples in JMP community as below.
The script is needs to be updated though.
Delete Symbols();
Names Default To Here( 1 );
//Define Seperate function
SeparateString = Function( {TheString},
TheList = Words(TheString," ");
Return( TheList );
);
dt = Current Data Table();
Summarize( sn = by( :SN ) );
serial_total = sn;
//dt2 = New table("tmp", New Column("serialnumber",character, set values(sn)));
New Window("Debug",
H List Box(
V List Box(TEXT BOX("Copy and Paste SerialNumber list", <<set font style("Bold")),
H List Box(
Icon Box( "SearchIndex" ),
Spacer Box( size( 5, 10 ) ),
item_search_teb = Text Edit Box( "",
<<set width( 200 ),
// The filter_items function does the work
<<set nlines( 10 )
),
reset_button = Button Box( "",
<<set icon( "DebuggerDeleteBreakpoint" ),
<<set script(
// Clear the filter and call the callback function
item_search_teb << set text( "" );
),
<<set tip( "Clear filter" )
),
)
,
Button box("Filtering",
tmp =Eval(item_search_teb <<get text);
str = "MD5 MD6 MD7 MD8 ";
split_str = Words(str," ");
split_tmp = Words(tmp," ");
serial_list = SeparateString(tmp);
total_flag =Associative Array( serial_total );
list_flag = Associative Array( serial_list );
total_flag << intersect (list_flag);
serial_total = total_flag << get keys;
)
)
,
Panel Box( "SerialNumber list : " ,
disp_box = List Box( sn, Max Selected( 1 ), width( 200 ), nlines( 10 ) ),
),
);
)
By the way, when I input below values in text edit box, it seems the extracted string has delimiter " ", but it cannot be splitted as I thought.
I added simple script to check if it is splitted well, as you can see below figure, "str" can be splitted, however, "tmp" cannot.
When I put the values to excel and compare it with Exact function, both value is just same, but seems like JSL classified two variable as different one.
tmp =Eval(item_search_teb <<get text);
str = "MD5 MD6 MD7 MD8 ";
split_str = Words(str," ");
split_tmp = Words(tmp," ");
Could you find out what is the difference and let me know the solution?
Many thanks!