Require all string to be quoted

When entering a string in a variable comparison condition/action (e.g. ‘Compare the text of an object variable’) you need to quote it (e.g. “My string”). I understand why quotes are necessary (Why double quotes are required to set manually?) so that’s not a problem.

image

What is a problem is when entering string variables in the variable/instance editor. There you don’t need to add quotes. Indeed, if you do add them you end up with a different string altogether.

E.g.

image

vs.

image

Results in this:

Peek 2022-08-24 13-27

So I’d like to propose making all strings require quotes (i.e. in the variable/instance editors). This will reduce confusion of needing to know/remember when to use quotes and when not to.

3 Likes

As you define the secon red as a String literally is “red” as a full string.

Is like this
coluor as String = red is a string of 3 characters
coulour as String = “red” is a string of 5 characters
So to compare is something like


variable cloour = "red"
variable colour = "\"red"\"

But this last one is common in programming languages but Im not sure it will wor in GDevelop in the Comopare two strings function.