Class variables
You can unload a collection of class variables either with their current values or with new values that you set. If you set new values, ENVY/App overwrites the values existing in the image into which the variables are being loaded.
You use the method dumpClassVariable:in: to unload class variables with their current values, and dumpClassVariable:withValue:in: to unload them with new values.
Two examples illustrate how to unload class variables
Example: Unloading a class variable with its current value
Suppose a class named Alpha has the following definition:
Object subclass: #Alpha
classInstanceVariableNames: 'a b'
instanceVariableNames: 'c d'
classVariableNames: 'E F'
poolDictionaries: 'G'
To unload the class variable "E" with its current value into a file named alpha.ic, you use statements in the following code fragment:
"Step 2: Unload the class variable E into alpha.ic."
| result |
(result := ApplicationDumper new)
...
dumpClassVariable: 'E' in: Alpha;
...
dumpIntoFileNamed: 'alpha.ic' path: '.' using: ComponentMaps.
...
Example: Unloading a class variable with a specific value
"Step 2: Unload the class variable E having a value 100 into alpha.ic."
| result |
(result := ApplicationDumper new)
...
dumpClassVariable: 'E' withValue: 100 in: Alpha;
...
dumpIntoFileNamed: 'alpha.ic' path: '.' using: ComponentMaps.
...
Last modified date: 01/29/2015