PennController for IBEX › Forums › Support › Can we use template literals in Pcibex? › Reply To: Can we use template literals in Pcibex?
May 11, 2023 at 2:13 am
#10559
Jeremy
Keymaster
Hi,
PennController elements do not correspond to any native javascript type, and in particular PennController Var elements do not correspond to javascript variables. As illustrated here, you can pass a Var element to the text
command on a Text element to set its value dynamically. In your case, it would look something like this:
newVar("hitext").set(getVar("ID")).set(v=>`hi, ${v}`), newText("instructions-1").text( getVar("hitext") )
Jeremy