[Implemented] Surcharge des fonctions

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Fred wrote:
The optional parameters for procedure will be implemented in PB very soon as it can be useful. It's not a function overloading, it's just a default value for parameters when not specified. Example:

Code:


Procedure MyPlot(x, y, Color = $FF)
..
EndProcedure

MyPlot(x,y) ; Red as default
MyPlot(x,y, RGB(51,51,51))
Who gave you that idea :?: :idea:
That's useful, and easy to implement, isn't it?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It works like this in C/C++. And yes it's easy to implement :wink:
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

Fred wrote:It works like this in C/C++. And yes it's easy to implement :wink:
Well, not in C ;)
AmiBlitz also does this now I think ;)
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

AmiBlitz also does this now I think ;)
Wops! I didn't know :roll:
Well, not in C ;)
Well, welcome a new C language. There was C, after that C++, and after that C;)
Post Reply