It is currently Fri Jul 19, 2019 5:12 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: tailbite and default parameters
PostPosted: Thu Aug 04, 2011 7:34 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Aug 03, 2011 4:52 am
Posts: 215
Location: Beirut, Lebanon
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

_________________
PureBasic: Surprisingly simple, diabolically powerful


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Thu Aug 04, 2011 7:47 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5754
Location: Berlin - Germany
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

_________________
PureBasic 5.70 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Thu Aug 04, 2011 8:36 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1143
Location: Germany
Please have a look at the reference manual here : http://www.tailbite.com/help/Reference/usingtailbitefrompurebasic.html


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Fri Aug 05, 2011 4:50 am 
Offline
Enthusiast
Enthusiast

Joined: Wed Aug 03, 2011 4:52 am
Posts: 215
Location: Beirut, Lebanon
Thank you, both

_________________
PureBasic: Surprisingly simple, diabolically powerful


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Wed Aug 10, 2011 9:21 pm 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 8004
Location: Fort Nelson, BC, Canada
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)

_________________
Veni, vidi, vici.


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Thu Aug 11, 2011 7:43 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
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.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Thu Aug 11, 2011 7:59 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 8004
Location: Fort Nelson, BC, Canada
It definitely happens here:

Image

_________________
Veni, vidi, vici.


Top
 Profile  
Reply with quote  
 Post subject: Re: tailbite and default parameters
PostPosted: Thu Aug 11, 2011 8:01 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 8004
Location: Fort Nelson, BC, Canada
Aha! It only happens if the sources are currently loaded in the IDE! So really, no problem. uh, nevermind... :oops:

_________________
Veni, vidi, vici.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye