The Trow() function, when used in this manner, will stop script execution and write the quoted string to the log. Additionally, if Throw() is generated from a Window action, an alert window will also appear with the message.
If you wanted to stop the execution of the script when those columns do not exist, you can use the Throw() function to do so. You can either include the rest of the script within the Try or after the try, either way, the script will stop execution when an error occurs.
Also, using the section of your code below will fail even if the columns do exist since you cannot AND (&) columns together to return anything. Error message is "Cannot convert argument to a number [or matrix] in access or evaluation of 'And'"
Column (mydt, "Value") & Column (mydt, "Parameter");
This example below will print "rest of script" to the log when Big Class table is opened and will throw a message to the log if it is not. I have just included references to both columns to test that the exist.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
Try(
Column( dt, "height" );
Column( dt, "weight" );
,
Throw( "height and weight columns do not exist" )
);
Print( "rest of script" );
Justin