My JSL function script below pulls a file from a network folder and outputs it in a data file for use elsewhere. How do I output the error message "This limit file does not exist! Check file name" together with the datafile. I am on JMP13.
Names Default To Here( 1 );
getLimitsFile = Function({LimFileName}, {dtspk},
dtspk = Try(
Open(
"\\gbshyt-ppor-334e\DBX\XPD\System\Limits\"||LimFileName||".txt",
columns(
New Column( "ParameterName", Character, "Nominal" ),
New Column( "ColumnLSL", Character, "Nominal" ),
New Column( "ColumnUSL", Character, "Nominal" ),
New Column( "ColumnUnits", Character, "Nominal" ),
New Column( "ColumnSymb", Character, "Nominal" ),
New Column( "ColumnComm", Character, "Nominal" )
),
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Tab, Comma, CSV( 1 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Use Regional Settings( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 1 ),
Data Starts( 2 ),
Lines To Read( "All" ),
Year Rule( "20xx" )
)
//,invisible)
),"This limit file does not exist! Check file name");
return(dtspk);
);
Also, in the case of an error, how to stop further execution of the code where the function is used and show the user a dialog box with the error message?
When it's too good to be true, it's neither