System Functions
What's new in Analytica 4.0? >
RunConsoleProcess
Declaration:
RunConsoleProcess(program:text[],cmdLine:optional text[]; stdIn : optional text[]; block : optional boolean[] ; curDir : optional text[] ; priority : optional numeric[] ; showErr : optional numeric[])
Requires Analytica Enterprise or Power Player.
ReadTextFile
ReadTextFile( filename : textual )
Requires Analytica Enterprise or Power Player.
Present and documented in 3.1 User Guide p198.
WriteTextFile
WriteTextFile(filename : textual ; text : coerce textual ; append,warn : optional numeric ; sep : optional textual )
Requires Analytica Enterprise or Power Player. Present and documented in 3.1 User Guide p198.
ShowPdfFile
Launches Adobe Acrobat or Acrobat reader, if installed, and displays an Adobe Acrobat PDF file. The file might contain documentation or a user guide for your model, for example, and could be opened by a button script. Declaration:
ShowPdfFile(filename : atomic textual; bookmark : optional atomic textual ; search,bookmarks : optional atomic boolean )
You can optionally specify a bookmark within the PDF file to open to. However, this will have no effect for users who only have a newer (post 2004) version the free Acrobat Reader installed. Around 2004, Adobe removed this capability from their free reader. Also, you can specify whether the bookmark panel or search panel should be visible when the document opens, which again does nothing on the newer free Acrobat readers.
GetRegistryValue
Reads a value from the Windows system registry. This can be quite useful if you install your Analytica model as part of a larger application, and if your model needs to find certain data files on the user's computer (for example, for use with ReadTextFile or RunConsoleProcess). The locations of those files could be stored in the registry by your installer, so that your model knows where to look. Declaration:
GetRegistryValue( root : atomic textual ; subfolder,name : optional atomic textual; warn : optional atomic boolean )
The root must be one of:
- "HKCR" or "HKEY_CLASSES_ROOT"
- "HKLM" or "HKEY_LOCAL_MACHINE"
- "HKCU" or "HKEY_CURRENT_USER"
- "HKPD" or "HKEY_PERFORMANCE_DATA"
- "HKCC" or "HKEY_CURRENT_CONFIG"
- "HKDD" or "HKEY_DYN_DATA"
Subfolder specifies the path from the root to the folder containing the key of interest. The levels of the path may be separated by "/" or "\". If the root is "HKLM" and the subfolder begins with "ANA" or "ANAVER", the Analytica application folder is used, for example: "ANA"==>"Software/Lumina Decision Systems/Analytica" and "ANAVER"==>"Software/Lumina Decision Systems/Analytica/3.2". (Note: In a private label version, the path mapped to by ANA will be different.) If the root is "HKCU" and the subfolder begins with "ANA", the Analytica folder for the current user is used ("Software/Lumina Decision Systems/Analytica" (again, this path is different in a private label version). Examples of these would be:
GetRegistryValue( "HKLM", "ANAVER", "home" ) GetRegistryValue( "HKCU", "ANA/MOT", "rootdir" )
Name specifies the value name within the subfolder to retrieve.
The following registry data types are recognized and are returned as the indicated Analytica type
- REG_SZ and REG_EXPAND_SZ: Returned as Text
- REG_DWORD: Returned as Numeric
- REG_MULTI_SZ: Returned as a null-indexed list of text strings.
- REG_NONE: Returned as Null (without warning)
- Any other: An embedded warning is issued and Null returned.
If the subfolder or value is not found, a warning is issued, null returned. The various warnings that might occur can be suppressed either by setting the optional Warn parameter to False, or by wrapping the function call in an IgnoreWarnings function.
This function cannot be used to alter or enumerate registry data. Analytica does not provide a function to change registry data.
Enable comment auto-refresher