Picomite/PicoMiteVGA V5.07.05 release candidates


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4334
Posted: 12:27pm 03 Oct 2022      

  phil99 said  ...
I had assumed everything produced by MM.INFO() was a string and use Val() to get the number
...
MMM.INFO$(CPUSPEED) Returns the CPU speed as a string.


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 $.

  The Manual said  MM.INFO$(CPUSPEED) Returns the CPU speed as a string.


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.

Best wishes,

Tom
Edited 2022-10-03 23:06 by thwill