PRO loadgrid, meshfilein, _extra = ex ; ; @cm_4mesh ccmeshparameters.filename = meshfilein ; split the name according to "," delimiter meshfile = strsplit(meshfilein, ',', /extract) meshfile = strtrim(meshfile, 2) ; try to find a .pro file with this name... filepro = (find(meshfile[0], /firstfound, /onlypro))[0] ; if this is an idl batch file or a procedure if filepro NE 'NOT FOUND' THEN BEGIN CASE protype(filepro) OF ; this is a procedure 'proc':listing = file_basename(filepro, '.pro') ; this is a function, this case is not coded... 'func':stop ; this is an IDL batch file 'batch':listing = '@'+file_basename(filepro, '.pro') ENDCASE ENDIF ELSE BEGIN filenc = (find(meshfile[0], /firstfound, /onlync))[0] if filenc EQ 'NOT FOUND' THEN stop listing = 'initncdf, ''' + filenc +'''' ENDELSE ; add the arguments and keywords if necessary IF n_elements(meshfile) GT 1 AND strmid(listing, 0, 1) NE '@' THEN BEGIN FOR i = 1+(filepro NE 'NOT FOUND'), n_elements(meshfile)-1 DO listing = listing + ', ' + meshfile[i] ENDIF IF strmid(listing, 0, 1) NE '@' THEN listing = listing + ', strcalling = ''' + meshfilein + ''', _extra = ex' createpro, listing, filename = myuniquetmpdir +'for_createpro.pro', _extra = ex return END