;;$Id: string_array.pro,v 1.1 1998/10/19 20:51:10 beth Exp $ ;; ;; NAME: ;; ;; string_array.pro ;; ;; PURPOSE: ;; This IDL procedure calls a CALL_EXTERNAL routine which demonstrates ;; how to pass strings into external code. ;; This code: ;; 1) implements a simple interface to the external code. ;; 2) check the type of arguments that will be passed to the external code ;; ;; CATEGORY: ;; Dynamic Link ;; ;; CALLING SEQUENCE: ;; This routine is called from IDL using the following commands: ;; IDL>string_array ;; or ;; IDL>string_array,'hello' ;; or ;; IDL>string_array,['one','two','three'] ;; ;; INPUTS/OUTPUTS: ;; strarr - a scalar string or array of strings. If the input is not ;; of type string, a conversion will be attempted. ;; ;; KEYWORDS: ;; DEBUG - If this keyword is unset, this routine will return to the ;; caller on any error. If this keyword is set, this routine will ;; stop at the point of the error. ;; ;; SIDE EFFECTS: ;; None. ;; ;; RESTRICTIONS: ;; None. ;; ;; MODIFICATION HISTORY: ;; Written May, 1998 JJG ;; PRO string_array,strarr,DEBUG=debug IF NOT(KEYWORD_SET(debug)) THEN ON_ERROR,2 strarr = (SIZE(/TNAME,strarr) EQ 'UNDEFINED') ? ['a','bb','ccc','d'] :$ STRING(strarr) PRINT,'Calling string_array with:' HELP,strarr PRINT,format='(a)',strarr result = CALL_EXTERNAL(lib_name('call_examples'),'string_array',strarr,$ N_ELEMENTS(strarr),/S_VALUE,/PORTABLE) PRINT,'Result from string_array is:' HELP,result end