-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In-Game: string() and show_debug_message() should add support for {{ and }} to escape the brace characters #8564
Labels
documentation
Improvements or additions to documentation are required by this issue
feature request
New feature (or a request for one)
Milestone
Comments
YYBartT
added a commit
to YoYoGames/GameMaker-Manual
that referenced
this issue
Dec 6, 2024
…d compile time YoYoGames/GameMaker-Bugs#8564 * string() function page: * Added the situations in which curly braces aren't replaced in a format string * Added that curly braces can be escaped by doubling them, e.g. "{{" and "}}"
Added a paragraph on the |
verified as of IDE v2024.1300.0.719 Runtime v2024.1300.0.731 |
string
inconsistent braces handling between runtime and compile time
Note that the same change was made for show_debug_message() also, so I have added this to the title here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation are required by this issue
feature request
New feature (or a request for one)
Description
When
string
is applied at the runtime, all numbers between curly braces are replaced with corresponding arguments (unless no corresponding argument is found, then they're passed as-is). There seems to be no special behaviour that would allow escaping the braces by doubling them like in C#.However, if a
string
call is resolvable at compile time, the double curly braces are treated as non-placeholder single braces, the way C# runs its string.Format.Whether the intended behaviour is to allow escaping double curly braces or just replacing patterns as-is, this is an inconsistency between equivalent runtime and compile time behaviours. I don't mind either way (although I prefer having an option to escape than not), as long as runtime and compiler agree.
Steps To Reproduce
Create an empty project and a script with a following code:
The result is:
That's presumably because C# escapes double-braces as non-placeholder single braces, while runtime simply searches and replaces "digits between braces" pattern.
Which version of GameMaker are you reporting this issue for?
IDE v2024.1100.0.700 Runtime v2024.1100.0.718
Which operating system(s) are you seeing the problem on?
Windows 10.0.19045.0
Which platform(s) are you seeing the problem on?
HTML5, Windows
a7695c1c-4a00-4b58-a231-9667d33eaf28
The text was updated successfully, but these errors were encountered: