Page 1 of 1

autocast of numeric values when string are involved

Posted: Mon Dec 24, 2012 7:33 pm
by Zebuddi123
For those who have not noticed one of the latest additions in 5.10b1

Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants

Very usefull and great addition

Code: Select all

b=10 : a$="a"
Debug a$+b ;  =  a 10

#b=100
#b$="cool"
#a$=#b$+#b
Debug #a$ ; = cool100

; but #a$=#b+#b$ doesnt work
Zebuddi. :D

Re: autocast of numeric values when string are involved

Posted: Mon Dec 24, 2012 9:54 pm
by jassing
Zebuddi123 wrote:Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants
I always liked strong typing, it makes it absolute what you want to do.
Imaging you are concatenating strings -- but you type "Amount" instead of "Amount$" which may contain very different values -- you wouldn't get a compiler error, and debugging might be harder...

Re: autocast of numeric values when string are involved

Posted: Mon Dec 24, 2012 10:48 pm
by Zebuddi123
yes true. but i dislike .s for strings so i allways use $.

Merry Xmas & Happy New year to All

Zebuddi. :D

Re: autocast of numeric values when string are involved

Posted: Tue Dec 25, 2012 4:10 am
by netmaestro
; but #a$=#b+#b$ doesnt work
That's just a bug, Fred's on it. It will work soon.