GMS 2 Span String Argument Over Multiple Lines

TheMagician

Member
In GMS 1.4 you could span a String argument over multiple lines which enabled nice things like creating a map using JSON formatting:

Code:
map_game = ds_map_create();

map_game = json_decode('
{
  "Player":
  {
    "x":0,
    "y":0,
    "Inventory":
    {
      "0":"Rope",
      "1":"Money",
      "2":"Flower"
    }
  }
}
');
Now in GMS 2 there are multiple problems:
  1. You can't use ' anymore to define a string, only " works
  2. If you use more than one line for the string you get the error "Unterminated String Literal"
Are there any plans to bring this functionality back?
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
It's via @"" or @'' strings.
Code:
map_game = json_decode(@'
{
    "Player":
    {
        "x":0,
        "y":0,
        "Inventory":
        {
            "0":"Rope",
            "1":"Money",
            "2":"Flower"
        }
    }
}
')
 
Top