[SOLVED] How to make optional parameter in procedure?

Just starting out? Need help? Post your questions and find answers here.
avatar
User
User
Posts: 35
Joined: Fri Apr 16, 2010 11:43 am

[SOLVED] How to make optional parameter in procedure?

Post by avatar »

I see a lot of procedure/function in PB is having optional parameter
For example, Result = ButtonGadget(#Gadget, x, y, Width, Height, Text$ [, Flags])
The "Flags" is optional parameter

How can I create such procedure/function in PB with optional parameter?
Last edited by avatar on Sat Apr 24, 2010 8:56 am, edited 1 time in total.
User avatar
KJ67
Enthusiast
Enthusiast
Posts: 218
Joined: Fri Jun 26, 2009 3:51 pm
Location: Westernmost tip of Norway

Re: How to make optional parameter in procedure?

Post by KJ67 »

Code: Select all

Procedure Test(A, B, C=2)
EndProcedure

Test (2,3)
Test (2,3,4)
http://www.purebasic.com/documentation/ ... dures.html
The best preparation for tomorrow is doing your best today.
avatar
User
User
Posts: 35
Joined: Fri Apr 16, 2010 11:43 am

Re: How to make optional parameter in procedure?

Post by avatar »

Thanks
Post Reply