PureBasic Forum
https://www.purebasic.fr/english/

tailbite and default parameters
https://www.purebasic.fr/english/viewtopic.php?f=26&t=47082
Page 1 of 1

Author:  morosh [ Thu Aug 04, 2011 7:34 pm ]
Post subject:  tailbite and default parameters

hello:
I noticed that default parameters should be used each time a procedure using them is called, am I wrong??
Example:
library file:
Code:
ProcedureDLL.u incu(var.u, x.u=1 )
  ProcedureReturn var+x
EndProcedure


test file:
Code:
x.u =11
Debug incu(x,2)        ;good
;Debug incu(x)      ; wrong

Author:  ts-soft [ Thu Aug 04, 2011 7:47 pm ]
Post subject:  Re: tailbite and default parameters

The Syntax for Tailbite:
Code:
ProcedureDLL.u incu2(var.u, x.u)
  ProcedureReturn var + x
EndProcedure
ProcedureDLL.u incu(var.u)
  ProcedureReturn var + 1
EndProcedure

Author:  ABBKlaus [ Thu Aug 04, 2011 8:36 pm ]
Post subject:  Re: tailbite and default parameters

Please have a look at the reference manual here : http://www.tailbite.com/help/Reference/usingtailbitefrompurebasic.html

Author:  morosh [ Fri Aug 05, 2011 4:50 am ]
Post subject:  Re: tailbite and default parameters

Thank you, both

Author:  netmaestro [ Wed Aug 10, 2011 9:21 pm ]
Post subject:  Re: tailbite and default parameters

ts-soft wrote:
The Syntax for Tailbite:
Code:
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)

Author:  gnozal [ Thu Aug 11, 2011 7:43 am ]
Post subject:  Re: tailbite and default parameters

netmaestro wrote:
ts-soft wrote:
The Syntax for Tailbite:
Code:
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.

Author:  netmaestro [ Thu Aug 11, 2011 7:59 am ]
Post subject:  Re: tailbite and default parameters

It definitely happens here:

Image

Author:  netmaestro [ Thu Aug 11, 2011 8:01 am ]
Post subject:  Re: tailbite and default parameters

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

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/