Page 1 of 1

Typeless procedure parameter?

Posted: Thu Dec 13, 2007 9:31 pm
by Mistrel
Is it possible to make a typeless parameter to create a procedure similar to debug?

For example:

Code: Select all

mydebug("Hello!")
mydebug(32)

Posted: Thu Dec 13, 2007 9:49 pm
by Fluid Byte
Wheres the Problem with converting?

Code: Select all

mydebug("Hello!")
mydebug(Str(32))

Posted: Thu Dec 13, 2007 10:11 pm
by Mistrel
There's no problem doing that within the procedure. But my question is if it's possible to create a typeless parameter. Type checking would need to be done inside the procedure but I don't think PB supports that.

Posted: Thu Dec 13, 2007 10:20 pm
by srod
PB doesn't support function overloading etc.

Posted: Thu Dec 13, 2007 10:22 pm
by Mistrel
Thanks. :)

Posted: Thu Dec 13, 2007 10:22 pm
by Fluid Byte
Use a macro instead then.

Posted: Thu Dec 13, 2007 10:35 pm
by Trond
Fluid Byte wrote:Use a macro instead then.
Doesn't help, you're only pushing the problem down. What do you do in the macro? PB has no TypeOf().

Posted: Fri Dec 14, 2007 3:57 am
by Matt
is function/procedure overloading on the list todo?

Posted: Fri Dec 14, 2007 4:23 am
by freak
Matt wrote:is function/procedure overloading on the list todo?
Nope. It would require a stricter typing system than the one PB has.