Hello friends!
I´m using Hollywood in a OOP way and I ised to use a function like constructor for my objects....you know.
But, what if I want to create a different constructor that accept, for example, arguments? Hoy can I use the same name of the function?
Hope you understand!
Thanks!
Simulating C++ Constructors
Re: Simulating C++ Constructors
You could use a function with "variable number of arguments" (see documentation)
Code: Select all
Function test(...)
; arguments will be stored in table 'arg'
DebugPrint(arg.n .. " arguments")
EndFunction
test()
test(5,6)
test(1,9,"aaa",b)
Re: Simulating C++ Constructors
Mazze, you are amazing!
Now I remember had read something in the documentation. Thanks!