• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion I see " replaced '

  • Thread starter Primordial Games
  • Start date
P

Primordial Games

Guest
Been pulling hair out at the most simple of code.... I typically use ord('_') to handle my keyboard inputs and such.
Been getting unhelpful errors.... of course a google search brings up GM1 topics and what I had normally is completely acceptable.

Anyways. ' has been replaced with "

Cant say I agree with this but what ever. Im just very used to quotations being strings, often human readable and the apostrophe ' used for symbols and such. Most of the time the two can be used interchangeably

anyways this could break lots of peoples code if they reuse things. And the error only gave something along the lines :
number of arguments expected 1 got 0

which could cause confusion.


-----
some search words in case others come across the issue:
keyboard_check
gamemaker studio 2
ord('w')
ord("w")
 
N

NPT

Guest
I find it kind of odd that YYGs found it important not to change:
  • colour representation from bbggrr to rrggbb
  • true being .5 and greater, false being less than .5, instead of non-zero and zero
claiming it was important not to break backwards compatibility.

But, they completely dropped the equvalency of apostrophes(') to quotes(").

I'm guessing, it wasn't an easy choice and the likely explanation was the conversion of GML to an underlying language such as C++ is much easier and less prone to introducing errors as the new usage is more similar to the usage in some other languages.

A notice of depracation in the 1.4 documentations would be benificial.
 

Mike

nobody important
GMC Elder
Strings on the whole tend to be constant, and while you add characters it's rare that you add chr(35) for a hash or a chr(39). So in general all strings are usually converted properly. As long as it's a constant, it'll convert properly.

Colours on the other hand are constantly built up from calculations, from LELPs to fades to HSV to just putting in a variable. This makes it virtually impossible to convert without error, and means imported games would virtually always look wrong.
The same goes for true/false. When it comes to backward compatibility, there is a surprising amount of code that depends on the current condition, so this again would break imported games.

In theory, we could have supported 2 modes. One for new projects, and one for old. But this was too much of a maintenance nightmare so never took off.

On import, you will get a list of everything that's changed, it's certainly worth a look.....
 
Do apostrophes still work for defining strings? If not, how do you get around setting a string that contains apostrophes and quotation marks like you would in GMS1:
Code:
str = 'James#"' + "It's" + 'a beautiful day!"';
I hope it's less painful.
 

FrostyCat

Member
Do apostrophes still work for defining strings? If not, how do you get around setting a string that contains apostrophes and quotation marks like you would in GMS1:
Code:
str = 'James#"' + "It's" + 'a beautiful day!"';
I hope it's less painful.
Single quotes are no longer valid for denoting strings. GMS 2 has switched over to the standard escape sequences used in most modern languages.
Code:
str = "James\n\"It\'s a beautiful day!\"";
 
Top