Tests if a parameter was actuallypresent in the call to a procedure or function.
2) When the keyword was not used in the call.
2) When the keyword or parameter was not present in the call.
PRO test, Key = k
IF (PARAM_PRESENT(k)) THEN $ PRINT, 'Key is present' $
ELSE PRINT, 'Key is not present'
IF (KEYWORD_SET(k)) THEN $ PRINT, 'Key is set' $ ELSE PRINT, 'Key is NOT SET'
PRINT, 'Number of elements in Key = ', N_ELEMENTS(k)
END WAVE test
Key is not present
Key is NOT SET
Number of elements in Key = 0
WAVE test, Key = 0
Key is present
Key is NOT SET
Number of elements in key = 1
WAVE test, Key = a
Key is present
Key is NOT SET
Number of elements in key = 0
WAVE a = 10 WAVE test, Key = a
Key is present
Key is SET
Number of elements in Key = 1
For more information on parameter checking, see Hardware-dependent Math Error Handling in Chapter 10 of the PV-WAVE Programmer's Guide.