http://gilgamesh.hamsterrepublic.com/cgi-bin/bugzilla/show_bug.cgi?id=422


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
          Component|Graphics                    |General (game+custom)
         Resolution|FIXED                       |
            Summary|Only the first sprite set   |GOSUBs and nested FOR
                   |appears in FreeBasic 0.17   |problem in FreeBasic 0.17+
                   |custom                      |




------- Comment #11 from [EMAIL PROTECTED]  2007-08-18 19:54 -------
I found that the bug disappears and reappears depending on a few details. It
arises in a lot of forms. Here's one that compiles in -lang fb:

FOR a as integer = 0 TO 1
 print "loop 1 a=" & a
 GOSUB test
 print "loop 2 a=" & a
NEXT a
END

test:
FOR b as integer = 0 TO 5
NEXT b
RETRACE

C:\FreeBASIC17>drawsnip
loop 1 a=0
loop 2 a=6

Now, if you get rid of the "as integer"s and compile with "-lang deprecated",
it goes away. But if the code is a bit more complex, it comes back:
fin = 2
FOR a  = 0 TO fin
 print "loop 1 a=" & a
 GOSUB test
 print "loop 2 a=" & a
NEXT a
END

test:
 FOR b = 0 TO 2
   print " " & b   'STR$(b) doesn't exhibit the problem
 NEXT b
RETRACE

C:\FreeBASIC17>drawsnip
loop 1 a=0
 0
 1
 2
loop 2 a=0

Anyway, it seems the reason you only see it sometimes is because it's a memory
corruption bug, and as far as I can tell, it IS happening generally, but only
sometimes corrupts the temp FOR loop variables. It's not a nested GOSUB
problem, but a nested FOR loop with GOSUB problem.

I test FB0.18.1, and it behaves identically.


-- 
Configure bugmail: 
http://gilgamesh.hamsterrepublic.com/cgi-bin/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to