Optional Params & Macros !! woohoo

Everything else that doesn't fall into one of the other PB categories.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Optional Params & Macros !! woohoo

Post 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