Difference between revisions of "CurrentDataFolder"

m (adding doc status category)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:System Functions]]
 
[[Category:System Functions]]
 +
[[Category:File system functions]]
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
 
[[Category:Doc Status C]] <!-- For Lumina use, do not change -->
  
The current data directory is the default paths for loading or storing data.  Relative files paths are interpreted relative to this directory.  File dialogs for data (e.g., export, import) will appear initially in this directory, and functions such as [[ReadTextFile]], [[WriteTextFile]], or [[NlpDefine]]'s trace file treat their filename parameter as relative to the current data directory.
 
  
Changing directories in a open or save file dialog may change the current data directory.
+
==CurrentDataFolder(''directoryPath'')==
  
Analytica also has a [[CurrentModelDirectory]], which determines the default path for saving an loading models and modulesWhen a model is loaded, the CurrentDataDirectory is set, by default, to the current model directory.  The two may changed separately.
+
The current data folder is the default directory for reading or storing data by functions such as [[ReadTextFile]](), [[WriteTextFile]](), and [[SpreadsheetOpen]]()If you specify relative paths as parameters to these functions, they interpret them as relatvie to this folder.
  
The call with no parameters:
+
With no parameters, [[CurrentDataFolder]](), returns the full path for the current data directory.
CurrentDataDirectory()
 
returns the full path for the current data directory.
 
  
The call with one parameter:
+
With one parameter, [[CurrentDataFolder]](«directoryPath»), sets the current data folder to «directoryPath», which may be relative to the current folder or a full path. Given a valid path, it returns the new full path to the current data folder.   
CurrentDataDirectory(directoryPath)
 
sets the current data directory to the indicated path (if valid), and returns the full path of the current data directory afterwardsThe parameter can be a relative path, but the full path is returned.
 
  
= Declaration =
+
If you change the folder in an open or save file dialog from a file read or write function, it will change the current data folder.
  
CurrentDataDirectory( dirPath : optional textual atomic )
+
There is also a current model folder, accessed with [[CurrentModelFolder]](), that is the default directory for saving and loading models and modules.  When you start a model, [[CurrentDataFolder]] is set, by default, to the current model folder.  But the current data and model folders may change separately thereafter.
  
= See also =
+
==History==
 +
[[CurrentDataFolder]]() is new to [[Analytica 4.6]]. But in [[Analytica 4.5]] and earlier, the same function exists as [[CurrentDataDirectory]]().
  
* [[CurrentModelDirectory]]
+
== See also ==
 +
* [[CurrentModelFolder]]
 +
* [[CurrentDataDirectory]]
 
* [[ReadTextFile]]
 
* [[ReadTextFile]]
 +
* [[ReadCsvFile]]
 
* [[WriteTextFile]]
 
* [[WriteTextFile]]
 
* [[NlpDefine]]
 
* [[NlpDefine]]

Latest revision as of 04:24, 4 March 2021


CurrentDataFolder(directoryPath)

The current data folder is the default directory for reading or storing data by functions such as ReadTextFile(), WriteTextFile(), and SpreadsheetOpen(). If you specify relative paths as parameters to these functions, they interpret them as relatvie to this folder.

With no parameters, CurrentDataFolder(), returns the full path for the current data directory.

With one parameter, CurrentDataFolder(«directoryPath»), sets the current data folder to «directoryPath», which may be relative to the current folder or a full path. Given a valid path, it returns the new full path to the current data folder.

If you change the folder in an open or save file dialog from a file read or write function, it will change the current data folder.

There is also a current model folder, accessed with CurrentModelFolder(), that is the default directory for saving and loading models and modules. When you start a model, CurrentDataFolder is set, by default, to the current model folder. But the current data and model folders may change separately thereafter.

History

CurrentDataFolder() is new to Analytica 4.6. But in Analytica 4.5 and earlier, the same function exists as CurrentDataDirectory().

See also

Comments


You are not allowed to post comments.