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.
Example: Unloading a class variable with its current value and Example: Unloading a class variable with a specific value illustrate how to unload class variables.
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 1: Unload the class variable E into alpha.ic." | result | (result := ApplicationDumper new) ... dumpClassVariable: 'E' in: Alpha; ... dumpIntoFileNamed: 'alpha.ic' path: '.' using: ComponentMaps. ...
Suppose, for the class Alpha defined in Example: Unloading a class variable with its current value, you want to unload the class variable "E" with a current value of 100 into a file named alpha.ic. To do so, you use the following code fragment:
"Step 1: 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. ...