VarName | Name of variable to put trace on. |
DbGlobalName | Name of variable in globals table to update whenever traced variable is written to. |
Currently, there is no option for this command to begin the link by first reading the database global value into the Tcl variable. However, it is still possible to accomplish this yourself with a series of commands (viz. GetDbGlobal).
To stop updates, call UnlinkVarFromDbGlobal
You may wish to take a look at the documentation about the XxxDbGlobal commands: About XxxGlobal.
Check About Configuration for Database Use for info about how to set up Gen for using database-related commands.
This code: (1) Creates a variable, (2) Links it to a database global, (3) Shows that the database global has the same value, (4) Changes the value, (5) Shows that the database global also changes.
% set MyVar 123
% LinkVarToDbGlobal MyVar
% puts [GetDbGlobal MyVar]
123
% set MyVar 345
345
% puts [GetDbGlobal MyVar]
345