In the Init function, Change function, PageEnd function, ShowPage function and save function it is possible to see variables from other configuration pages. This means that you can read and write them, and enable/disable the elements they belong to.
The variables are referred to as function name@variable name. If you eg. have a variable called count on the menupage backup, then you can do the following:
set backup@count 1
{${backup@count} == 1} {...}
Disable backup@count
If the variable is an associative array ( Menu, Radio, ListBox), ComboBox the TCL syntax is a bit different, when you read the variable:
if {[set backup@count(index)] == 1} {...}
If the variable is in an extended entry, you have to do a forevery on the variable with the function@ prefix, and the variables will be named with the function@ prefix too. If we say we have an extentry called alias on the menupage misc, and it consists of name and value, then it could look like this:
forevery misc@alias { if {${misc@name} == ""} { Disable misc@value } }
If you want to refer to a fillOut element on another page, the save, change, pageEnd and init functions, foreach fillOutElm, have to be a bit different from what we already have learned.
Instead of just referring to the variable, you have to write [expand variable_name] and for associative arrays [expand variable_name variable_index]. Here's an example which will clarify the matter.
CheckBox checkbox -text "Just a checkbox" Radio radio \ -text radio -entries { "option 1" "option 2"} FillOutElm fill -entries checkbox radio \ -save { if {[expand checkbox] == 1} { print "radio = [expand radio name]" } }
If referencing to this page wasn't nessecary, you could just have written:
FillOutElm fill -entries checkbox radio \ -save { if {$checkbox == 1} { print "radio = $radio(name)" } }