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

Last change on this file since 285 was 285, checked in by smasson, 17 years ago

allways return back a scalar is /firstfound used

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