Reply To: GetVar Error

PennController for IBEX Forums Support GetVar Error Reply To: GetVar Error

#10787
Jeremy
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