samspade
Member
In doing some experimenting it seems like the following is valid, but according to the manual it is undocumented.
This makes sense, but is undocumented as the manual page for method says the following:
I'm not sure how much value understanding this has, but while I was working through how method variables and bindings work, I thought I would try this and it turns out to be valid.
GML:
///Inside An Instance (not a script asset)
global.a_variable = 0;
a_function = method(global, function() {
a_variable += 10;
show_debug_message(a_variable);
});
a_function(); //prints the value 10
method(struct_ref_or_instance_id, function);
Unless of course global is an instance id, but if so you would expect it to work in a with statement (which it doesn't).I'm not sure how much value understanding this has, but while I was working through how method variables and bindings work, I thought I would try this and it turns out to be valid.