PennController for IBEX › Forums › Support › GetVar Error › Reply To: GetVar Error
July 24, 2023 at 2:43 am
#10787
![](https://www.pcibex.net/wp-content/uploads/2018/10/IMG_8365-e1540835663655-150x150.jpg)
Keymaster
Hi,
You cannot reference a Var element in a newX
command, because elements are created upon opening the experiment but evaluated upon runtime
The solution is to use the .text
command:
newTrial('test', newVar('var-int','hello') , newText('text') .text( getVar('var-int') ) .print() , newButton('button','Click') .print() .wait() )
Jeremy