Overview
The global variable, _path, is reserved by the system to hold the directory and path name of the current working directory. The _path variable is set to the empty string "" at system startup. It is the programmer??s responsibility to initialize the _path variable. When the _path variable is referenced, the text contents of the _path variable are automatically attached to the beginning of database archive file named in the new function.
Type:
Global VariableWhen To Use
The _path is a global variable use to hold a path name string assigned by the programmer. If the _path variable is something other than a null string, the _path variable string will be prepended to the filename specified in the new function
Example 1
| (setq _path "") | ;;Reset the _path variable |
|---|---|
| (setq arcFile (new ObjectRepository: "myarchive.odb")) | ;; Set database archive file to "myarchive.odb" |
Example 2
| (setq _path "d:\\test\\") | ;; Set the _path variable to "d:\test" |
|---|---|
| (setq arcFile (new ObjectRepository: "myarchive.odb")) | ;; Set database archive file to "d:\test\myarchive.odb" |
Notes & Hints
[...under construction...]
Overview
The _saveTypes is a global variable that contains a Boolean value. The contents of the _saveTypes variable determines the calculation of the object closure when objects are saved to an Object Repository. At system startup, the _saveTypes variable is initialized to False. If the _saveTypes variable is later set to True, global value and type information are to be saved along with symbol objects.
Type:
Global VariableWhen To Use
Analytic Information Server Symbols have the two properties associated with them: type property and global value property. Typically, the preservation of type and global value information is needed when a Symbol is being used as a container. However, Symbols, are themselves data and may not be associated with a type or value. In the latter case, the type and global value properties are not important. The _saveTypes variable allows the programmer to control whether type and global information should be saved along with a Symbol object when the object is saved in an Object Repository.
Example 1
| (defineStructure x: Old1:) | ;; Global type info linked to x |
|---|---|
| (setq x #(1 2 3)) | ;; Global value stored in x |
| (setq y x:) | ;; y contains the Symbol x: |
| (setq db (new ObjectRepository: "test.db")) | |
| (setq _saveTypes false) | ;; Do NOT save Symbol global and type info |
| (setq db[0] y) | ;; Save record data only |
| (setq x #void) | ;; Destroy global value in x |
| (defineStructure x: New1: ) | ;; Destroy global type info in x /td> |
| (setq y db[0]) | ;; Read previously saved record into y |
| ((writeln ??y = ?? y ??, x = ?? x ??, fieldsof (x) = ?? (fieldsOf x: ) ) |
The result output from the writeln statement is: y = x, x = #void, fieldsof (x) = #{New1: #void}
Note that the contents of the Symbol x: is #void.
Note that the type information of the Symbol x: is different from the original defineStructure, statement.
Example 2
| (defineStructure x: Old1:) | ;; Global type info linked to x |
|---|---|
| (setq x #(1 2 3)) | ;; Global value stored in x |
| (setq y x:) | ;; y contains the Symbol x: |
| (setq db (new ObjectRepository: "test.db")) | |
| (setq _saveTypes true) | ;; DO save Symbol global and type info |
| (setq db[0] y | );; Save Symbol global and type info |
| (setq x #void) | ;; Destroy global value in x |
| (defineStructure x: New1: ) | ;; Destroy global type info in x |
| (setq y db[0]) | ;; Read previously saved record into y |
| (writeln ??y = ?? y ??, x = ?? x ??, fieldsOf (x) = ?? (fieldsOf x: ) ) |
The database archive file name is now y = x, x = #void, fieldsof (x) = #{New1: #void}
Note that the contents of the Symbol x: is the Vector #(1 2 3).
Note that the type information of the Symbol x: is the same as the original defineStructure statement.
Notes & Hints
[...under construction...]