Function : Default parameters

Feature requests for future versions of Hollywood can be voiced here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Function : Default parameters

Post by djrikki »

It would be helpful in some projects if we were able to specify default parameters on a Function statement something akin to ES6/ES2015 in JavaScript.

Code: Select all

/* example */
Function Say(word = "Hello World!")
   DebugPrint(word)
EndFunction

Say("Hello Andreas!")
Say()
Output:

Code: Select all

Hello Andreas!
Hello World!
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Function : Default parameters

Post by airsoftsoftwair »

Unlikely to happen because it'd require extensive work on the VM. There are ways to do it, however. See here: https://stackoverflow.com/questions/602 ... -arguments
Post Reply