thwill Guru Joined: 16/09/2019 Location: United KingdomPosts: 4334
Posted: 12:27pm 03 Oct 2022
Hi Phil,
As you quote MM.INFO() and MM.INFO$() are interchangeable, and on the PicoMite if you edit a program and use MM.INFO$() and then reopen the same program in the editor you will see it has changed to MM.INFO() without the $. You don't see the same on the CMM2 because the CMM2 editor edits files whilst the PicoMite editor is looking at the program in flash and MM.INFO() and in flash MM.INFO$() use the same token.
However the actual type returned by the MMBasic interpreter is independent of the use of $ and is specific to the name of the "thing" requested, e.g. MM.INFO$(DISK SIZE) does not report an error and returns an Integer despite the $.
OK, so I rephrase my question:
"Why was it decided that the CPU speed should be returned as a string?"
Except for diagnostic purposes the only logical uses of this information would require an integer - i.e. changing behaviour or reporting an error if the CPUSPEED isn't greater/less than some specific value.