Got an idea for enhancing PureBasic? New command(s) you'd like to see?
c4s
Addict
Posts: 1981 Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany
Post
by c4s » Fri Mar 01, 2013 1:09 pm
Works as expected with PB 5.10:
Code: Select all
str$ = "1" + 2
Debug str$ ; Output is "12", great! :)
...should work as well as the compiler
knows that we are working with a string:
Code: Select all
str$ = 1 + "2"
Debug str$ ; Output should be "12"
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Puffolino
User
Posts: 49 Joined: Thu Jan 05, 2012 12:27 am
Post
by Puffolino » Fri Mar 01, 2013 3:11 pm
Would also be fine to allow to set user defined casts, like {string}, {integer}, {double} etc.
Code: Select all
s.s="2"
debug {integer} Val( {string} 1 + "." + s ) / 3
c4s
Addict
Posts: 1981 Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany
Post
by c4s » Fri Mar 01, 2013 6:53 pm
...well, that's not part of
my feature request though.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
Little John
Addict
Posts: 4777 Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany
Post
by Little John » Fri Mar 01, 2013 7:12 pm
c4s wrote: Works as expected with PB 5.10:
Code: Select all
str$ = "1" + 2
Debug str$ ; Output is "12", great! :)
...should work as well as the compiler
knows that we are working with a string:
Code: Select all
str$ = 1 + "2"
Debug str$ ; Output should be "12"
+ 1
ts-soft
Always Here
Posts: 5756 Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany
Post
by ts-soft » Fri Mar 01, 2013 7:16 pm
and the same for other types like:
Code: Select all
value.i = 1 + "2"
Debug value ; Output should be 3
value.i = "1" + 2
Debug value ; Output should be 3
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.