Page 1 of 1

Optional Params & Macros !! woohoo

Posted: Wed Feb 08, 2006 3:56 am
by NoahPhense

Code: Select all

Global Dim blah.s(1)

Procedure PureBasic()
  blah(0) = "PureBasic"
EndProcedure

Macro ThisRocks(a="",b="")
  a#b() ; calling above ;)
EndMacro

ThisRocks(Pure,Basic)

Procedure.s test(a.s, b.s = " v4.0 with Optional Parameters!!!")
  ProcedureReturn a+b
EndProcedure

Debug test(blah(0), "")
Debug test(blah(0), " v4.0")
Debug test(blah(0))
- np