Why double quotes are required to set manually?

I asking me why double quotes are required to set manually and why this isn’t set as standard from gdevelop by itself?

As example:

  • Change the animation (by name)

I know, if text (strings) is requiered double quotes are requiered too.
At numbers there are no double quotes needed.

Quotes are needed to tell GDevelop “Hey what I am writing here is text not an expression”. As an expression doesn’t contains numbers, GDevelop does not need that for numbers, and it also let GDevelop know if a number should be interpreted as text or numbers (e.g. “0” + “1” = “01” as text is just concatenated, but 0 + 1 = 1 as numbers have actual math applied to them).

2 Likes

Ahh, ok, good argument!:wink:
But when gdevelop await a text (string) - like in my emaple Change the animation (by name) - double quotes should set by standard (not manually)!:blush:

It does not expect any text, in your example expressions are also possible. “GlobalVariable(house)” would not work.

2 Likes

To combine both Jack and Arthuro’s responses:

What the field is looking for is not quoted text, but a string. You create a string by either wrapping normal text or numbers in quotes, or by building a string using expressions. If you automatically wrapped everything in qutoes, expressions would no longer work.

More detail: Computers are exact, they normally do not “infer” or guess what you want, and systems that try to do that are currently bad at it… If the field required quotes, and automatically applied them, it would have no way to know the difference between you writing the sentence “Use a + GlobalVariable(test) + here.” and “Use a” + GlobalVariable(test) + “here”. Because with your method it would automatically add quotes.

2 Likes