Menu

do loop, strange behavior

2023-07-03
2023-07-03
  • Jan Kromhout

    Jan Kromhout - 2023-07-03

    We wont to use the doloop for the scamp3 and find this after testing:

    : testloop cr 10 0 do i . cr loop ;   ok
    

    testloop
    32758
    32758
    32758
    32758
    32758
    32758
    32758
    32758
    32758
    32758
    ok

    Using this version : flashforth/pic24/forth/doloop.fs
    Are we do sommeting wring?

    Thanks for any help

     
    👍
    1
  • Mikael Nordman

    Mikael Nordman - 2023-07-03

    I think the problem is that John has in the scamp defined the word I to work with FOR/NEXT as:

    : i r@ ; 
    

    That prevents the the word I for DO/LOOP to be defined and the wrong I will be used.
    I believe I asked John not to do this back in 2018, but he did it anyway.

    You can get around this by changing doloop.fs to define I with another name, II for example.

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.