? [fixed] VAL inconsistent behaviour. (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password
Creep into the Halloween / Horror Programming Contest (Deadline Extended)

[fixed] VAL inconsistent behaviour.

  • #1 ✎ 471 SquareFingers 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. Posted Edited by SquareFingers
  • #2 ✎ 55 brilliance360 First Week Joined in the very first week of SmileBASIC Source Website Spring 2017 Contest Participant I participated in the SmileBASIC Source Spring 2017 Contest! Programming Contest Deep Sleep Hidden Website 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... Posted
  • #3 ✎ 265 NeatNit 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") Posted Edited by NeatNit
  • #4 ✎ 55 brilliance360 First Week Joined in the very first week of SmileBASIC Source Website Spring 2017 Contest Participant I participated in the SmileBASIC Source Spring 2017 Contest! Programming Contest Deep Sleep Hidden Website
    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( )
    Posted
  • #5 ✎ 265 NeatNit Yep, my mistake. Thanks! Posted
  • #6 ✎ 471 SquareFingers
    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.
    Posted
  • #7 ✎ 98 LohadL Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements Pokemon Is Awesome! I love Pokemon! Express Yourself 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 Posted Edited by LohadL
  • #8 ✎ 265 NeatNit
    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
    Posted
  • #9 ✎ 98 LohadL Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements Pokemon Is Awesome! I love Pokemon! Express Yourself 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. Posted
  • #10 ✎ 265 NeatNit Yeah, I thought the same. Best to trickle them in one at a time at a moderate pace Posted
  • #11 ✎ 471 SquareFingers
    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.
    Posted
  • #12 ✎ 98 LohadL Amazing Contributor Someone thinks I'm an awesome person who has done so much for the community! Achievements Staff Pick "Your program is one of our favorites!" - Staff Achievements Pokemon Is Awesome! I love Pokemon! Express Yourself Just confirmed - it'll be fixed in the next version and all NeatNit's examples will spit out a 0. Posted