PennController for IBEX › Forums › Support › GetVar Error › Reply To: GetVar Error
July 24, 2023 at 2:43 am
#10787
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