New autocast feature!

Mac OSX specific forum
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

New autocast feature!

Post by WilliamL »

I thought this was a syntax error but I see now (thanks to ts-soft) that it is a new feature!

Code: Select all

EnableExplicit
Define a.i=10
Define a$

;a$=a ; this is ok and gives a syntax error
a$="This="+a ; gives 'This=10' and no syntax error
;a$="This="+Str(a) ; should be this?
Debug a$
Last edited by WilliamL on Fri Dec 20, 2013 10:18 pm, edited 2 times in total.
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Shouldn't this be a syntax error?

Post by ts-soft »

It is a new feature of PB5.10 LTS, autocast number to string!

//edit
History wrote:- Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
WilliamL
Addict
Addict
Posts: 1259
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Re: Shouldn't this be a syntax error?

Post by WilliamL »

Thanks ts-soft!

I missed that!

That is about the only explanation I could think of but it never occurred to me that it was a new feature.

I thought that I might be losing my mind.

Maybe I should change my subject line to something more descriptive?

...I don't see that line in the Announcements. Where is 'History'?

[later] I found the line here http://www.purebasic.com/news64.php at the PB site. That was version 5.1 (like you said).
MacBook Pro-M1 (2021), Tahoe 26.2, PB 6.30b6
Post Reply