;+ ; ; @file_comments ; A kind of KEYWORD_SET but when the value exist, it ; send it back. ; ; @categories ; Utilities ; ; @keyword VAR ; any kind of ; ; @returns ; 0 if the variable does not exist ; ; @examples ; IDL> print, testvar(var=toto) ; 0 ; IDL> print, testvar(var='toto') ; toto ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; 14/12/1999 ; ; @version ; $Id$ ; ;- ; FUNCTION testvar, VAR = var ; compile_opt idl2, strictarrsubs ; if keyword_set(var) then return, var ELSE return, 0 end