|
Post by tsh73 on Feb 19, 2021 8:46:01 GMT
Found while translating program from other BASIC: Can i make questions about BASIC (no Just BASIC) here? justbasiccom.proboards.com/thread/638/make-basicBug exists in LB 4.5.1 and Just BASIC 1.01 as well We know (by experience) that unary minus not supported in JB. BUT: Unary minus from array of function call while in brackets - does not get flagged as error - but does not work right (instead of calling function/returning array value, returns argument) It is hard-to find error. Like, "I know R(i) is 0. So (-R(i)*some other stuff) should be 0, is it?" y(3)=123
i = 3 print y(i) '123 print (0-y(i)) '-123 print (-y(i)) 'expected error, got 3 'it doesn't actually access array (it would error out of 0..10 print (-y(654)) 'expected error, got 654 print (-y(-654)) 'expected error, got -654
'same thing about functions print print f(i) 'in function, x=3 // 3.01 print (0-f(i)) 'in function, x=3 // -3.01 print (-f(i)) 'expected error, got 3 'it doesn't actually access function - no message "in function" print (-f(654)) 'expected error, got 654, no message "in function"
function f(x) print "in function, x=";x f=x+0.01 end function
Results: 123 -123 3 654 -654
in function, x=3 3.01 in function, x=3 -3.01 3 654
|
|