14th February 2013 : Version 5.10
- Added: autocast of numeric values when string are involved, allowing to concatenate string and numeric in constants
I must confess I've never been able to bring myself to trust it, I always use Str(). Something just seems not right about being able to code like that. Probably just me, I'm happy it's there for those who like it, which is likely most coders.
netmaestro wrote:I must confess I've never been able to bring myself to trust it, I always use Str(). Something just seems not right about being able to code like that.
In my case that lead to an unexpected result due to a typo in my code.
Anyway, I will never use this feature because it appear very odd to me.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
netmaestro wrote:I must confess I've never been able to bring myself to trust it, I always use Str(). Something just seems not right about being able to code like that. Probably just me, I'm happy it's there for those who like it, which is likely most coders.
With strings the '+' is also valid for combining the contents of two strings, where the result will be assigned to the string on the LHS with the '=' operator or will be directly stored into the string on the LHS. Numeric values are also accepted for combination with a string. It will behave like using Str(), Str() or StrD() with their defaults for the optional parameters.
Example:
a$ = b$ + " more" ; Combines the content of the string "b$" with the string " more" and save this into the string "a$"
a$ + b$ ; Attach the content of the string b$ directly to the string a$. a$ = b$ + 123
netmaestro wrote:I must confess I've never been able to bring myself to trust it, I always use Str(). Something just seems not right about being able to code like that.
[...]Anyway, I will never use this feature because it appear very odd to me.
Yeah, it looks and feels like using a scripting language, I only use this for quick debug phrases.
Just remember that if it starts with a string (even an empty one) everything that follows is considered as text EXCEPT for explicit mention (by using a function)