PB5.41LTSb1 no default value for string-pseudotypes

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Regenduft
Enthusiast
Enthusiast
Posts: 121
Joined: Mon Mar 02, 2009 9:20 pm
Location: Germany

PB5.41LTSb1 no default value for string-pseudotypes

Post by Regenduft »

PureBasic 5.41 LTS Beta 1
It's not possible to use a default value for string pseudotype parameters except numerical ones.

Code: Select all

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
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB5.41LTSb1 no default value for string-pseudotypes

Post by Fred »

it's not supported.
User avatar
Regenduft
Enthusiast
Enthusiast
Posts: 121
Joined: Mon Mar 02, 2009 9:20 pm
Location: Germany

Re: PB5.41LTSb1 no default value for string-pseudotypes

Post by Regenduft »

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: Select all

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?
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB5.41LTSb1 no default value for string-pseudotypes

Post by Fred »

Yes, should be safe.
Post Reply