psychopy.org | Reference | Downloads | Github

Are there exceptions to the rule that "When you see a $ in builder, it indicates that the input is presumed not to be a literal string"?

Win10:
PsychoPy version 2021.1.4
Standalone

What are you trying to achieve?:

I’m trying to understand the convention regarding dollar signs ($) that are part of the GUI display. I’m operating under the presumption that “When you see a $ in builder, it indicates that the input is presumed not to be a literal string,” and that “When you don’t see a dollar sign, it means that the input is presumed to be a literal string” (and not a number, for example).

However, there seems to be at least one exception to that rule. If I select a TEXT component and look at the words, “STOP DURATION(S)”, there’s no $ preceding the field where the duration is to be entered, and the field’s pre-populated value (1.0) doesn’t itself include a $ to indicate that 1.0 isn’t a literal string. Yet, if I add a $ (thus, $1.0), it produces a “syntax error.” So, foe consistency, should the GUI indicate (for example) “STOP DURATION(S) $” rather than “STOP DURATION(S)”?

Try experimenting with a variable name. I did notice an exception recently— there was a $ in the definition of the Text field of a text component but it does need a $ to interpret as code.