$setproperty
$setproperty
Changes the settings of certain device properties of the registry variables file.
Syntax
$setproperty(section, property, newsetting)
Parameters
section | A character string or an expression that evaluates to a character string to indicate the group of properties or registry values that should be changed. |
property | A character string or an expression that evaluates to a character string to name the property or register that should be changed. |
newsetting | A character string or an expression that evaluates to a character string containing the new value for the property or register value. |
Return Value
A character string containing “1” ($True) if the arguments to the function were valid and newsetting was applied. Otherwise, it returns “0” ($False).
Comments
If more than one $setproperty is used during the generation of a report, then only the last $setproperty is in effect when the report is printed.
Care should be taken when changing the setting of registry values, as improper manipulation can result in program or system failure.
The following are possible values for section, property and their corresponding newsetting:
“DESKTOP” |
Changes properties of Zim desktop. |
property and newsetting | The only possible value for a desktop property is “ScreenUnits” which accepts the following newsetting:
0 = screen units are pixels; |
“PRINTER” | Sets printer properties of the default printer. |
property and newsetting
|
Possible values for a printer property and corresponding newsetting are:
“Color” or “Colour” = 1, Monochrome; 2, color; |
“SESSION” | Sets properties for the current session of Zim. |
property and newsetting
|
Possible values for the Zim session property and the corresponding newsetting are the ones described in the Zim configuration options for the current database. See Zim Database Configuration File (zimconfig.zim) for further details. |
“REG:[sub-section]” or “INI:[sub-section]” | Sets any properties of this user-defined sub-section. |
property and newsetting
|
property and newsetting can have any values because they are user-defined. |
“SESSION”:
“REG:[ODBC]” | To programmatically create an ODBC data source connection. |
property and newsetting
|
Possible values for the ODBC Driver data source property and the corresponding newsetting are:
The data source name = must be $getproperty(“REG:[ODBC]”, “VERSION”); For more information, see Configuring a Data Source. |
If running the Zim executable, the section “REG:[…]” sets the registry values in the machine where Zim Server is running because Zim only runs in the same machine as Zim Server runs.
If running the Zim Thin executable, the section “REG:[…]” sets the registry values in the machine where Zim Thin is running.
In order to set registry values in the machine where Zim Server is running when running Zim Thin, you must use the section “SERVREG:[…]” which has the same meaning and syntax as “REG:[…]”.
Examples
let vSet = $setproperty (“printer”, “fontsize”, “12”)
Sets the font size of the default printer to 12.
let vSet = $setproperty (“REG:[MYSET]”, “My Setting”, “I like this one.”)
Sets “I like this one.” in the property “My Setting” belonging to the sub-section “MYSET”. This kind of setting is useful for applications to keep track of values used in the Zim application.
let vSet = $setproperty (“SESSION”, “Parameter Size”, “2000”)
Sets the database configuration option “Parameter Size” to 2000.
See Also