Page 1 of 1

PB5.41LTSb1 no default value for string-pseudotypes

Posted: Fri Dec 04, 2015 11:52 pm
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

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

Posted: Sat Dec 05, 2015 1:48 pm
by Fred
it's not supported.

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

Posted: Sun Dec 06, 2015 11:52 pm
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?

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

Posted: Mon Dec 07, 2015 7:37 am
by Fred
Yes, should be safe.