I would like a way to determine if my code is running in IDL 6.4+ or not, i.e., either GDL or IDL pre-6.4, so that I can use IDLnetURL or not. The straight-forward way of just trying to use IDLnetURL and catching an error if it occurs works in IDL, but not in GDL:
GDL> print, tx_hasneturl()
% Compiled module: TX_HASNETURL.
% Procedure not found: IDLNETURL__DEFINE
% Execution halted at: TX_HASNETURL 11 tx_hasneturl.pro
The code just attempts to instantiate IDLnetURL and catches any errors:
if (error ne 0L) then begin
o = obj_new('IDLnetURL')
It appears that CATCH does not actually catch the error? Is there a better way? I am on a recent GDL version:
GDL - GNU Data Language, Version 0.9rc2 CVS
Very sorry to have left this message unanswered.
CATCH is not implemented in GDL yet.
To check for GDL vs. IDL you can use: DEFSYSV, '!GDL', exists=exists