Difference between revisions of "CurrentModelFolder"

m (Lchrisman moved page CurrentModelDirectory to CurrentModelFolder: Changed preferred name of built-in function)
(EW 14658)
Line 2: Line 2:
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
Returns or sets the default directory from which models or modules are loaded, and from which relative paths for models or modules are interpreted.
+
''new to [[Analytica 4.6]], but in [[Analytica 4.5]] and earlier the name function is available but named <code>[[CurrentModelDirector]]()</code>.''
  
When called with no parameters, returns the current model directory with no side effects.
+
Returns or sets the default folder from which models or modules are loaded, and from which relative paths for models or modules are interpreted.
  
When called with a text parameter, sets the current model directory, interpreting the path provided relative to the previous current model directory.  It then returns the full absolute path to the new current model directory.
+
When called with no parameters, returns the current model folder with no side effects.
 +
 
 +
When called with a text parameter, sets the current model folder, interpreting the path provided relative to the previous current model folder.  It then returns the full absolute path to the new current model folder.
  
 
= Examples =
 
= Examples =
  
  CurrentModelDirectory( ) &rarr; "C:\Documents And Settings\Linda\My Documents"
+
  [[CurrentModelFolder]]( ) &rarr; "C:\Documents And Settings\Linda\My Documents"
  CurrentModelDirectory( "C:\Models" ) &rarr; "C:\Models"
+
  [[CurrentModelFolder]]( "C:\Models" ) &rarr; "C:\Models"
  CurrentModelDirectory( ) &rarr; "C:\Models"
+
  [[CurrentModelFolder]]( ) &rarr; "C:\Models"
  CurrentModelDirectory( "Active" ) &rarr; "C:\Models\Active"
+
  [[CurrentModelFolder]]( "Active" ) &rarr; "C:\Models\Active"
  
 
Select '''File->Add Module...'''.  File dialog opens in C:\Models\Active.
 
Select '''File->Add Module...'''.  File dialog opens in C:\Models\Active.
  
  CurrentModelDirectory( "..\Old" ) &rarr; "C:\Models\Old"
+
  [[CurrentModelFolder]]( "..\Old" ) &rarr; "C:\Models\Old"
  CurrentModelDirectory( "[My Documents]" ) &rarr; "C:\Documents And Settings\Linda\My Documents"
+
  [[CurrentModelFolder]]( "[My Documents]" ) &rarr; "C:\Documents And Settings\Linda\My Documents"
  
 
= Note =
 
= Note =
  
When you start Analytica, the CurrentModelDirectory starts out in [My Documents].  When you load a model, it is set to the directory containing the model, and modules with relative path names are loaded relative to that location.
+
When you start Analytica, the [[CurrentModelFolder]] starts out in [My Documents].  When you load a model, it is set to the directory containing the model, and modules with relative path names are loaded relative to that location.
  
 
You can change the default start directory by setting a registry setting.  Use RegEdit, navigate to the folder  
 
You can change the default start directory by setting a registry setting.  Use RegEdit, navigate to the folder  
Line 30: Line 32:
 
== ADE note ==
 
== ADE note ==
  
CAEngine::OpenModel and CAEngine::AddModule interpret file names as relative to the CurrentModelDirectory( ).  If you call CurrentModelDirectory from typescript prior to calling these, then the full path name does not have to be passed to those functions.
+
[[CAEngine::OpenModel]] and [[CAEngine::AddModule]] interpret file names as relative to the [[CurrentModelFolder]]( ).  If you call [[CurrentModelFolder]] from typescript prior to calling these, then the full path name does not have to be passed to those functions.
  
 
= See Also =
 
= See Also =
  
* [[CurrentDataDirectory]]
+
* [[CurrentDataFolder]]

Revision as of 22:01, 30 May 2014


new to Analytica 4.6, but in Analytica 4.5 and earlier the name function is available but named CurrentModelDirector().

Returns or sets the default folder from which models or modules are loaded, and from which relative paths for models or modules are interpreted.

When called with no parameters, returns the current model folder with no side effects.

When called with a text parameter, sets the current model folder, interpreting the path provided relative to the previous current model folder. It then returns the full absolute path to the new current model folder.

Examples

CurrentModelFolder( ) → "C:\Documents And Settings\Linda\My Documents"
CurrentModelFolder( "C:\Models" ) → "C:\Models"
CurrentModelFolder( ) → "C:\Models"
CurrentModelFolder( "Active" ) → "C:\Models\Active"

Select File->Add Module.... File dialog opens in C:\Models\Active.

CurrentModelFolder( "..\Old" ) → "C:\Models\Old"
CurrentModelFolder( "[My Documents]" ) → "C:\Documents And Settings\Linda\My Documents"

Note

When you start Analytica, the CurrentModelFolder starts out in [My Documents]. When you load a model, it is set to the directory containing the model, and modules with relative path names are loaded relative to that location.

You can change the default start directory by setting a registry setting. Use RegEdit, navigate to the folder

HKCU/Software/Lumina Decision Systems/Analytica 

and create a string value named InitialDir, set to the full file path of the starting directory.

ADE note

CAEngine::OpenModel and CAEngine::AddModule interpret file names as relative to the CurrentModelFolder( ). If you call CurrentModelFolder from typescript prior to calling these, then the full path name does not have to be passed to those functions.

See Also

Comments


You are not allowed to post comments.