LoginLogin
Might make SBS readonly: thread

[fixed] VAL inconsistent behaviour.

Root / SmileBASIC Bug Reports / [.]

SquareFingersCreated:
VAL("12 dogs") evaluates to zero. VAL("12 giraffes") evaluates to twelve. Honestly, it's as if they must have put some effort into creating bugs.

This looked too bizarre to not mess with. Unfortunately, the glitch doesn't seem to be associated with the word giraffes specifically, but string length instead where, after a certain length, SB stops seeing it as a string (or something?) and just registers the numbers at the beginning. So VAL("37 giraffes") is 37. Or VAL("1627GOOFS1") returns zero, but VAL("1627GOOFS12") returns 1627. Also, the string in VAL( ) has to start with a number, otherwise it looks like it always returns 0. I was honestly looking forward to some bizarre bug where the word giraffes registers as a number...

If you ask me, VAL("12 dogs") should also evaluate to 12. Square, please send this bug report to SmileBOOM so they could fix it for the next update! Edit: also, can you check what happens in the following cases?
VAR A$ = "12 dogs"
VAR B$ = "12 giraffes"
PRINT VAR(A$)
PRINT VAR("12 dogs")
PRINT VAR(B$)
PRINT VAR("12 giraffes")

VAR C$ = "12 "
VAR D$ = "12                   " 'just lost of spaces
PRINT VAR(C$)
PRINT VAR("12 ")
PRINT VAR(D$)
PRINT VAR("12                   ")

'Even later edit:
VAR THISBETTERWORK$ = "12"
PRINT VAL(THISBETTERWORK$)
PRINT VAL("12")

If you ask me, VAL("12 dogs") should also evaluate to 12. Square, please send this bug report to SmileBOOM so they could fix it for the next update! Edit: also, can you check what happens in the following cases?
VAR A$ = "12 dogs"
VAR B$ = "12 giraffes"
PRINT VAR(A$)
PRINT VAR("12 dogs")
PRINT VAR(B$)
PRINT VAR("12 giraffes")

VAR C$ = "12 "
VAR D$ = "12                   " 'just lost of spaces
PRINT VAR(C$)
PRINT VAR("12 ")
PRINT VAR(D$)
PRINT VAR("12                   ")

'Even later edit:
VAR THISBETTERWORK$ = "12"
PRINT VAL(THISBETTERWORK$)
PRINT VAL("12")
0 0 12 12 0 0 12 12 12 12 I assumed that all PRINT VAR( )'s were meant to be PRINT VAL( )

Yep, my mistake. Thanks!

If you ask me, VAL("12 dogs") should also evaluate to 12.
That is the way I would choose to resolve the inconsistency. But, no matter whether they resolve it one way or the other, either consistent behaviour is definitely better.
Square, please send this bug report to SmileBOOM so they could fix it for the next update!
Already done.

Hi SquareFingers, I took the liberty to tweet this directly to the Japanese Petitcom President Kobayashi, and he replied that he and his team added this issue to their bug list and will fix this in the next update once they figure out the exact reason. https://twitter.com/LohadL/status/671232577131438080

Hi SquareFingers, I took the liberty to tweet this directly to the Japanese Petitcom President Kobayashi, and he replied that he and his team added this issue to their bug list and will fix this in the next update once they figure out the exact reason. https://twitter.com/LohadL/status/671232577131438080
Welcome to SmileBASIC Source! :) Your Japanese might come in handy... There's plenty of other bugs to report :P

Thank you NeatNit! I frequent Miiverse more so I'll tweet about it if something's noteworthy. I don't want to come across as an annoying bug reporter though (let's admit it -- no CEO likes whiny customers even if they're right), so if the Japanese already found a similar bug or if it's too minor/obscure to reproduce, I'll keep my mouth shut.

Yeah, I thought the same. Best to trickle them in one at a time at a moderate pace

Hi SquareFingers, I took the liberty to tweet this directly to the Japanese Petitcom President Kobayashi, and he replied that he and his team added this issue to their bug list and will fix this in the next update once they figure out the exact reason. https://twitter.com/LohadL/status/671232577131438080
As NeatNit says, welcome! Thank you for doing that. I had already posted to Miiverse (under https://miiverse.nintendo.net/posts/AYMHAAACAAADVHklSy9oJg I posted https://miiverse.nintendo.net/replies/AYMHAAACAAADVHkp75rJKw), but I hope they will tolerate getting the same message from two directions.

Just confirmed - it'll be fixed in the next version and all NeatNit's examples will spit out a 0.