marco

Show in context Administrator User since 2016

If you want to be safe for future language improvements then you can write:

class Person {
	var _age
	var _name 
	
	func SetDefaults(name = "John Doe" , age = 0) {
		 if (name) _name = name
		if (age) _age = age	
	}
}

please note that instead of SetDefaults you could have an init function (the constructor) so your code will be much more easier to read. There is a small bug in the init constructor (when called with a different number of arguments) so you should wait few days for the next upcoming release.