Page 1 of 1
tailbite and default parameters
Posted: Thu Aug 04, 2011 7:34 pm
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
Re: tailbite and default parameters
Posted: Thu Aug 04, 2011 7:47 pm
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
Re: tailbite and default parameters
Posted: Thu Aug 04, 2011 8:36 pm
by ABBKlaus
Re: tailbite and default parameters
Posted: Fri Aug 05, 2011 4:50 am
by morosh
Thank you, both
Re: tailbite and default parameters
Posted: Wed Aug 10, 2011 9:21 pm
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)
Re: tailbite and default parameters
Posted: Thu Aug 11, 2011 7:43 am
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.
Re: tailbite and default parameters
Posted: Thu Aug 11, 2011 7:59 am
by netmaestro
It definitely happens here:
Re: tailbite and default parameters
Posted: Thu Aug 11, 2011 8:01 am
by netmaestro
Aha! It only happens if the sources are currently loaded in the IDE! So really, no problem. uh, nevermind...