Link

Purpose With Link you can link variables to entry fields.  In contrast to Set, the variable is updated automatically with the value entered by the user.  For example, you can use it when you fill fields automatically, and assume that the user might enter some of the fields manually as well. In particular, when you simplify transactions using your own InputFields, it makes sense to use Link on the hidden screens, if the user can call them up. 

There are 2 different formats, indicating 2 different directions of value setting when the screen is displayed: With one format the entry field is changed, with the other format the variable is changed.

Example Link F[Date] V[myDate]

The entry field  “Date” gets the value of the variable “myDate”, identical to  Set F[Date] "&V[myDate]".  In addition, after the user has entered a new date, the variable “myDate” is set to this value.

Link V[myDate] F[Date] 

The variable “myDate” gets the value of the entry field “Date”, identical to  Set V[myDate] "&[Date]".  In addition, after the user has entered a new date, the variable “myDate” is set to this value.

Format Link F[entry field] V[varname]  // the variable sets the entry field and receives newly entered values

Link V[varname] F[entry field]  // the variable gets the entry field value and receives newly entered values

Link cell[table,column,row]  V[varname]  //  the variable sets the table cell and receives newly entered values

Link V[varname] cell[table,column,row]  // the variable gets the table cell value and receives newly entered values

Tips&Tricks
  • You can find an example in Special Topic Moving fields between tabs
  • To compare the field value before input with the field value after input within an InputScript use the Link command and an additional variable to save the value before input. Example:

// GuiXT Script SetV[Amount_old]&F[Amount]

Link V[Amount_new] F[Amount]

// InputScript

// Amount changed?

if not V[Amount_new=&V[Amount_old]]

// action on value change

endif

Link