method_overloading
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| method_overloading [2018/01/24 12:51] – created wolfgangriedmann | method_overloading [2018/01/24 12:56] (current) – wolfgangriedmann | ||
|---|---|---|---|
| Line 25: | Line 25: | ||
| oClass:Foo( 1234 ) | oClass:Foo( 1234 ) | ||
| </ | </ | ||
| - | Please note: a different return type is not a different, so this will not compile: | + | Please note: a different return type is not a different |
| < | < | ||
| .... | .... | ||
| method Foo( cString as string ) as int</ | method Foo( cString as string ) as int</ | ||
| + | |||
| + | Of course this applies also to longer parameter lists. Here a sample piece of code that uses overloaded constructors and chains them: | ||
| + | < | ||
| + | protect _cFullName as string | ||
| + | |||
| + | constructor( cFullName as string ) | ||
| + | _cFullName := cFullName | ||
| + | return | ||
| + | | ||
| + | constructor( cSurname as string, cName as string ) | ||
| + | super( cName + " " + cSurname ) | ||
| + | return</ | ||
| + | |||
| + | |||
method_overloading.1516798299.txt.gz · Last modified: 2018/01/24 12:51 by wolfgangriedmann