tailbite and default parameters

TailBite specific forum

Moderators: gnozal, ABBKlaus, lexvictory

morosh
Enthusiast
Enthusiast
Posts: 293
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

tailbite and default parameters

Post by morosh »

hello:
I noticed that default parameters should be used each time a procedure using them is called, am I wrong??
Example:
library file:

Code: Select all

ProcedureDLL.u incu(var.u, x.u=1 )
  ProcedureReturn var+x
EndProcedure
test file:

Code: Select all

x.u =11
Debug incu(x,2)        ;good
;Debug incu(x)      ; wrong
PureBasic: Surprisingly simple, diabolically powerful
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: tailbite and default parameters

Post by ts-soft »

The Syntax for Tailbite:

Code: Select all

ProcedureDLL.u incu2(var.u, x.u)
  ProcedureReturn var + x
EndProcedure
ProcedureDLL.u incu(var.u)
  ProcedureReturn var + 1
EndProcedure
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: tailbite and default parameters

Post by ABBKlaus »

Please have a look at the reference manual here : http://www.tailbite.com/help/Reference/ ... basic.html
morosh
Enthusiast
Enthusiast
Posts: 293
Joined: Wed Aug 03, 2011 4:52 am
Location: Beirut, Lebanon

Re: tailbite and default parameters

Post by morosh »

Thank you, both
PureBasic: Surprisingly simple, diabolically powerful
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: tailbite and default parameters

Post by netmaestro »

ts-soft wrote:The Syntax for Tailbite:

Code: Select all

ProcedureDLL.u incu2(var.u, x.u)
  ProcedureReturn var + x
EndProcedure
ProcedureDLL.u incu(var.u)
  ProcedureReturn var + 1
EndProcedure
The only thing I don't like about this is that in the autocomplete box both incu( and incu2( show as selectable commands. It would be nice if there were a way for the tailbite devs to stop this from happening. (I realize it might not be possible)
BERESHEIT
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: tailbite and default parameters

Post by gnozal »

netmaestro wrote:
ts-soft wrote:The Syntax for Tailbite:

Code: Select all

ProcedureDLL.u incu2(var.u, x.u)
  ProcedureReturn var + x
EndProcedure
ProcedureDLL.u incu(var.u)
  ProcedureReturn var + 1
EndProcedure
The only thing I don't like about this is that in the autocomplete box both incu( and incu2( show as selectable commands. It would be nice if there were a way for the tailbite devs to stop this from happening. (I realize it might not be possible)
Now that's strange, it doesn't happen here.
PureCOLOR source wrote:ProcedureDLL.l PureCOLOR_SetButtonColor(GadgetNumber.l, TextColor.l, BackColor.l)
...
EndProcedure
ProcedureDLL.l PureCOLOR_SetButtonColor2(GadgetNumber.l, TextColor.l, BackColor.l, TextColorPushed.l)
...
EndProcedure
ProcedureDLL.l PureCOLOR_SetButtonColor3(GadgetNumber.l, TextColor.l, BackColor.l, TextColorPushed.l, BackColorPushed.l)
...
EndProcedure
Autocomplete only shows PureCOLOR_SetButtonColor() in both jaPBe and PB IDE.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: tailbite and default parameters

Post by netmaestro »

It definitely happens here:

Image
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8425
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: tailbite and default parameters

Post by netmaestro »

Aha! It only happens if the sources are currently loaded in the IDE! So really, no problem. uh, nevermind... :oops:
BERESHEIT
Post Reply