Page 1 of 1

[SOLVED] How to make optional parameter in procedure?

Posted: Sat Apr 24, 2010 8:23 am
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?

Re: How to make optional parameter in procedure?

Posted: Sat Apr 24, 2010 8:40 am
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

Re: How to make optional parameter in procedure?

Posted: Sat Apr 24, 2010 8:56 am
by avatar
Thanks