Hi, How can I conditionally and programmatically set a data type for a new column? I have a workaround that covers numeric / character, and it could be extended for other types, but I'm trying to get the method below (marked 'not working') to work. The log shows it is not recognizing the type variable. I've tried a few things like parse() but have been so far unsuccessful.
Names Default To Here( 1 );
dt = open( "$SAMPLE_DATA\Big Class.jmp");
colType = column(dtData,"Name") << get data type;
// doesn't work, error on colType
dt << add multiple columns("New Column", 1, After("Name"), colType);
// works
dt << add multiple columns("New Column", 1, After("Name"), Numeric);
if(colType == "Character", column(dt, "New Column") << data type ("Character"));
Thanks,
Mike