Welcome! Log In Create A New Profile

Advanced

Bug Report

Posted by Neil 
Bug Report
August 09, 2012 07:52PM
I don't know if you saw my last bug report but here it is again plus a new one


Sorry but with machineBASIC Version 2.04 you seem to have broken the floating point "IF" statment.
The following works with INT vars.
*******************************************************************************************

======================================
| machineBASIC Version 2.04
| Saves 0 |
| BV513_V2 Serial# 201203058
| |
| Documentation www.doc.bayac.com |
| Library www.mbasic.bayac.com |
| |
| Copyright Jim Spence 2012 |
======================================
ok
ok
// [1]
ok function xx() 
dim i, j 
   i=2 
   j=1 
     if i > j then 
         print "\r\nBig\r\n" 
     endif 
endf

ok
ok xx
Big

ok
******************************************************************

However if you do the same thing with floating point the following happens.

******************************************************************


// [2]
ok function zz() 
dim i#,j# 
  i#=2.0 
  j#=1.0 
  if i# > j# then
.....

ERROR (44) function does not return anything at if

ok
************************************************************************

NEW BUG WITH FOR LOOP

// [3]
function loop()
dim i
   for i = 1 to 10 
      print i,i*i,"\n\r"
   next i
endf

ok loop
ERROR (14) <at for loop> variable or function not found at (for)


********************************************************************************************


Happy bug fixing ...... Neil



Edited 1 time(s). Last edit at 08/10/2012 07:29AM by jimeer.
Re: Bug Report
August 10, 2012 08:14AM
Neil, thanks for the report, much appreciated.
[1][2] This is now fixed 2.04 201210059
[3] Cant find anything wrong with this actual code but you did mention floating point. There is an error in the documentation. The for/next loop only works with integer variables, a very early version used float as well but this had a massive impact on speed and so this was dropped but the documentation was not updated.
Re: Bug Report
August 17, 2012 10:26PM
Thanks - will try new version for case [1] [2] above

However in case [3] the loop var i is an int.
The code compiles error 14 is thrown at run time.

Thanks Neil
Re: Bug fixed
August 18, 2012 05:02PM
Have just loaded MB v2.04 59

This seems to fix the "IF" and "FOR loop" problem.

Thanks for your efforts.

I will report any new bugs found with as much evidence as possible

Regards Neil
Sorry, you do not have permission to post/reply in this forum.