Menu

"Out of memory" instead of "Undefined user function" the second time

2017-01-01
2017-01-01
  • Marcos Cruz

    Marcos Cruz - 2017-01-01

    After some investigation, I can confirm something strange happens with functions. It seems it's not related only to integer functions or recursion, as it seemed at first. Look:

    print fnz$(0)
    Undefined user function
    Ok 
    print fnz$(0)
    Out of memory
    Ok 
    

    The print commands were typed right after the boot of PC-BASIC 15.08.11. I typed the same code in the original GW-BASIC 3.23, and the second error is "Undefined user function" as expected.

    What do you think?

     
  • Rob Hagemans

    Rob Hagemans - 2017-01-01

    Hi Marcos, thanks for working this out! I think I know what's going on - PC-BASIC keeps track of what FN functions are being evaluated to be able to cut recursive calls short; it looks like that flag fails to get cleared if the function doesn't actually exist. That would be easy to fix - I'll check if this is the case.

    Rob

     
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.