It appears that combo boxes get messed up with blank entries. If you use a listbox instead it works, although one of the entries is a blank, which you don't want.
Here's the function I use to get unique values from a column, which uses the Summarize command:
//---------------------------------------------------------------------------
/* Function Name Get Unique Values
Description: Get the unique values for a column. For example:
Indications
------------
AAAAA
BBBBB
AAAAA
CCCCC
CCCCC
unique_list = get unique values (:Indications)
will return {"AAAAA", "BBBBB", "CCCCC"}
Arguments:
dtcol column descriptor to calculate unique values for
*/
Get Unique Values = Function( {dtcol},{default local},
// Eval/expr trickery to get this to work.
eval(eval expr(
Summarize(unique_list = By(expr(dtcol)))));
unique_list;
); // end get unique values
Here's an example that shows how to use the function. I read in the Car Physical Data table beforehand and blanked out some entries in the Country column.
dt = Open( "$sample_data\Car Physical Data.jmp" );
country_list = get unique values( Column( dt, "Country" ) );
for (i = nitems(country_list), i > 0, i--,
print(i);
if (country_list[i] == "",
remove from(country_list, i);
)
);
nw1 = New Window( "Example",
cb = Combo Box( country_list ),
Button Box( "OK", nw1 << close window )
);
nw2 = New Window( "Example",
lb = List Box( country_list ),
Button Box( "OK", nw2 << close window )
);
I suppose the best thing to do is to add the blank removal to the function.