VarName | Name of variable to link to. |
DbGlobalName | Name of global in globals table to link to. Optional. If omitted, will use VarName. |
Note that currently only Tcl global variables are supported.
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 and links it, (2) Shows that the database global has the same value, (3) Changes the value, (4) Shows the database global also changes, (5) Unlinks, (6) Creates the value, (7) Shows the database global does not change.
% set MyVar 123
123
% LinkVarToDbGlobal MyVar
% puts [GetDbGlobal MyVar]
123
% set MyVar 345
345
% puts [GetDbGlobal MyVar]
345
% UnlinkVarFromDbGlobal MyVar
% set MyVar 567
567
% puts [GetDbGlobal MyVar]
345