Just starting out? Need help? Post your questions and find answers here.
Mistrel
Addict
Posts: 3415 Joined: Sat Jun 30, 2007 8:04 pm
Post
by Mistrel » Thu Dec 13, 2007 9:31 pm
Is it possible to make a typeless parameter to create a procedure similar to debug?
For example:
Fluid Byte
Addict
Posts: 2336 Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany
Post
by Fluid Byte » Thu Dec 13, 2007 9:49 pm
Wheres the Problem with converting?
Code: Select all
mydebug("Hello!")
mydebug(Str(32))
Mistrel
Addict
Posts: 3415 Joined: Sat Jun 30, 2007 8:04 pm
Post
by Mistrel » Thu Dec 13, 2007 10:11 pm
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.
srod
PureBasic Expert
Posts: 10589 Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...
Post
by srod » Thu Dec 13, 2007 10:20 pm
PB doesn't support function overloading etc.
I may look like a mule, but I'm not a complete ass.
Mistrel
Addict
Posts: 3415 Joined: Sat Jun 30, 2007 8:04 pm
Post
by Mistrel » Thu Dec 13, 2007 10:22 pm
Thanks.
Fluid Byte
Addict
Posts: 2336 Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany
Post
by Fluid Byte » Thu Dec 13, 2007 10:22 pm
Use a macro instead then.
Trond
Always Here
Posts: 7446 Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway
Post
by Trond » Thu Dec 13, 2007 10:35 pm
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().
Matt
Enthusiast
Posts: 447 Joined: Sat May 21, 2005 1:08 am
Location: USA
Post
by Matt » Fri Dec 14, 2007 3:57 am
is function/procedure overloading on the list todo?
freak
PureBasic Team
Posts: 5940 Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany
Post
by freak » Fri Dec 14, 2007 4:23 am
Matt wrote: is function/procedure overloading on the list todo?
Nope. It would require a stricter typing system than the one PB has.
quidquid Latine dictum sit altum videtur