TScriptOverloading |
||||
Homepage TScript Overloading |
Overloaded Function DeclarationsTo support optional parameters and the thing called "overloading of functions" the following syntax has been introduced: message (string), (string, string), (string, string, integer) : integer; // Valid calls You can declare more than one argument pattern but only one return value type! OnExEval EventTo tell the user which kind of argument pattern was choosen a new kind of OnEval event was introduced. OnExEval event has a additional parameter "argpat" indicating which pattern was choosen. message ('Hallo'); //
argpat = 0 The decision which pattern fits the arguments is made dynamically during the evaluation. If you define two equivalent argument patterns the first from left to right is selected. |