Code: Select all
Val("0") ; returns 0
Val("1") ; returns 1
Val("2") ; returns 2
Val("3") ; returns 3
etc.
Val("a") ; returns 0
(since Val("-1") doesn't work anyway...)
Thanks for reading
fsw
Code: Select all
Val("0") ; returns 0
Val("1") ; returns 1
Val("2") ; returns 2
Val("3") ; returns 3
etc.
Val("a") ; returns 0

Code: Select all
Debug Val("-1")Code: Select all
Debug Val("$C85F")Code: Select all
Debug Val("%101010101")
Huh? Returns -1 here, as expected. Works just fine.fws wrote:(since Val("-1") doesn't work anyway...)

But thats definately bad what you suggest. How would you differ from the value of the constant and the right value? Why don't you check yourself if the number is okay?fsw wrote:Okay then return a #PB_ERROR constant value instead of zero.
Only because Basic's do something in a certain way doesn't mean it's the best way of doing things.
