Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[Fixed in 1.0.26+] Wierd bug with "var" (in GMS2 rather than GMLive?)

A topic by gnysek created Jan 29, 2020 Views: 261 Replies: 2
Viewing posts 1 to 3
(1 edit)

I've just noticed today, that you can write in GMS2 (and it's valid):

var a = 5, var b = 10;

and GMLive reports that as error ( "Expected a variable name, got keyword" ), and I think it's right in fact, as GM should throw an error here - however both compiler and editors allows it!

So, it's nothing major, but might be good to look into it (but after 2.3 release, as maybe they'll fix it there :) ).

Developer

There's a handful of weird things that you are allowed to do in plain GML - e.g. this is valid too

var var one globalvar var two
one := 1if (one := 1){end

I'm somewhat undecided whether it's worth spending time trying to mimic undocumented behaviours precisely instead of doing something else useful.

yeah, begin, end and := are there since GM 1.0 probably, and they were added by Mark cause he just adopted it from Delphi (probably for his own usage in fact, so he can write in similar style during tests).