source: trunk/ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.pro @ 69

Last change on this file since 69 was 69, checked in by smasson, 18 years ago

debug + new xxx

File size: 1.3 KB
Line 
1PRO loadgrid, meshfilein, _extra = ex
2;
3;
4@cm_4mesh
5  ccmeshparameters.filename = meshfilein
6; split the name according to "," delimiter
7  meshfile = strsplit(meshfilein, ',', /extract)
8  meshfile = strtrim(meshfile, 2)
9; try to find a .pro file with this name...
10  filepro = (find(meshfile[0], /firstfound, /onlypro))[0]
11; if this is an idl batch file or a procedure 
12  if filepro NE 'NOT FOUND' THEN BEGIN
13    CASE protype(filepro) OF
14; this is a procedure
15      'proc':listing = file_basename(filepro, '.pro')
16; this is a function, this case is not coded...
17      'func':stop
18; this is an IDL batch file
19      'batch':listing = '@'+file_basename(filepro, '.pro')
20    ENDCASE
21  ENDIF ELSE BEGIN
22    filenc = (find(meshfile[0], /firstfound, /onlync))[0]
23    if filenc EQ 'NOT FOUND' THEN stop
24    listing = 'initncdf, ''' + filenc +''''
25  ENDELSE
26; add the arguments and keywords if necessary
27  IF n_elements(meshfile) GT 1 AND strmid(listing, 0, 1) NE '@' THEN BEGIN
28    FOR i = 1+(filepro NE 'NOT FOUND'), n_elements(meshfile)-1 DO listing = listing + ', ' + meshfile[i]
29  ENDIF
30
31  IF strmid(listing, 0, 1) NE '@' THEN listing = listing + ', strcalling = ''' + meshfilein + ''', _extra = ex'
32
33  createpro, listing, filename = myuniquetmpdir +'for_createpro.pro', _extra = ex
34
35return
36END
Note: See TracBrowser for help on using the repository browser.