Skip to main content

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

[Implemented in 1.0.59+] Issue with the "delete" keyword

A topic by Benjamin Halko created Jun 26, 2022 Views: 221 Replies: 1
Viewing posts 1 to 2
(2 edits)

Whenever I have the delete keyword in an event and try to use GMLive, it says that there is an error: "Expected a statement, got ident".

This code produces the error:

/// @desc Test Logic
if(live_call()) return live_result;
function test() constructor {
    testWord = "hello";
}
testObject = new test();
delete testObject;

While this code does not:

/// @desc Test Logic
if(live_call()) return live_result;
function test() constructor {
    testWord = "hello";
}
testObject = new test();
//delete testObject;

IDE Version: 2022.5.1.16

Runtime Version: 2022.5.2.13

Developer

I don’t support delete yet - it’s a very strange keyword since it has to directly precede a valid reference to what you are deleting (delete varname, delete obj.varname, delete array[index], not delete function_that_returns_value()), and I have to write out every possible scenario for that to work.