It is currently Mon Jun 24, 2019 6:32 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: PB5.41LTSb1 no default value for string-pseudotypes
PostPosted: Fri Dec 04, 2015 11:52 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Mar 02, 2009 9:20 pm
Posts: 110
Location: Germany
PureBasic 5.41 LTS Beta 1
It's not possible to use a default value for string pseudotype parameters except numerical ones.
Code:
Prototype foo( txt.p-ascii = #Null$ )  ; <-- syntax error
Prototype foo( txt.p-ascii = #Empty$ ) ; <-- syntax error
Prototype foo( txt.p-ascii = "" )      ; <-- syntax error
Prototype foo( txt.p-ascii = @"" )     ; <-- syntax error
Prototype foo( txt.p-ascii = 0 )       ; <-- no error


Top
 Profile  
Reply with quote  
 Post subject: Re: PB5.41LTSb1 no default value for string-pseudotypes
PostPosted: Sat Dec 05, 2015 1:48 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13594
Location: France
it's not supported.


Top
 Profile  
Reply with quote  
 Post subject: Re: PB5.41LTSb1 no default value for string-pseudotypes
PostPosted: Sun Dec 06, 2015 11:52 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Mar 02, 2009 9:20 pm
Posts: 110
Location: Germany
Thanks for moving the thread to "Feature Requests and Wishlists". :D

Although not officially supported, the following code currently seems to be working correctly.
Code:
Prototype foo( txt.p-ascii = 0 )

The code is just like having a #Null$ default value.
This at least sometimes fits my needs.
But is it safe to be used that way?


Top
 Profile  
Reply with quote  
 Post subject: Re: PB5.41LTSb1 no default value for string-pseudotypes
PostPosted: Mon Dec 07, 2015 7:37 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13594
Location: France
Yes, should be safe.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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