source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.pro @ 186

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

bugfix tvplus + roms + xxx

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1;+
2; @file_comments
3;
4;
5; @categories
6;
7;
8; @param MESHFILEIN
9;
10;
11; @keyword _EXTRA
12; Used to pass your keywords
13;
14; @returns
15;
16;
17; @uses
18;
19;
20; @restrictions
21;
22;
23; @examples
24;
25;
26; @history
27;
28;
29; @version
30; $Id$
31;
32; @todo
33; seb
34;
35;-
36PRO loadgrid, meshfilein, _extra = ex
37;
38;
39;
40  compile_opt idl2, strictarrsubs
41;
42@cm_4mesh
43  ccmeshparameters.filename = meshfilein
44; split the name according to "," delimiter
45  meshfile = strsplit(meshfilein, ',', /extract)
46  meshfile = strtrim(meshfile, 2)
47; try to find a .pro file with this name...
48  filepro = (find(meshfile[0], /firstfound, /onlypro))[0]
49; if this is an idl batch file or a procedure 
50  if filepro NE 'NOT FOUND' THEN BEGIN
51    CASE protype(filepro) OF
52; this is a procedure
53      'proc':listing = file_basename(filepro, '.pro')
54; this is a function, this case is not coded...
55      'func':stop
56; this is an IDL batch file
57      'batch':listing = '@'+file_basename(filepro, '.pro')
58    ENDCASE
59  ENDIF ELSE BEGIN
60    filenc = (find(meshfile[0], /firstfound, /onlync))[0]
61    if filenc EQ 'NOT FOUND' THEN stop
62    listing = 'initncdf, ''' + filenc +''''
63  ENDELSE
64; add the arguments and keywords if necessary
65  IF n_elements(meshfile) GT 1 AND strmid(listing, 0, 1) NE '@' THEN BEGIN
66    FOR i = 1, n_elements(meshfile)-1 DO BEGIN
67      IF strpos(meshfile[i], '.') NE -1 THEN str = isnumber(meshfile[i]) ELSE str = createfunc('n_elements('+meshfile[i]+')')
68      IF str EQ 0 THEN listing = listing + ', ''' + meshfile[i] + '''' ELSE listing = listing + ', ' + meshfile[i]
69    ENDFOR
70  ENDIF
71
72  IF strmid(listing, 0, 1) NE '@' THEN listing = listing + ', strcalling = ''' + meshfilein + ''', _extra = ex'
73
74print, listing
75
76
77  createpro, listing, filename = myuniquetmpdir +'for_createpro.pro', _extra = ex
78
79return
80END
Note: See TracBrowser for help on using the repository browser.