Reset/empty string ARRAY$ ?


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4223
Posted: 12:08pm 11 Mar 2025      

  twofingers said  
  CaptainBoing said  ... and the syntactically accepted LENGTH is ignored for single variables. I think this extends to all 'mite flavours - anyone?...


I think this is only correct for PicoMites for lengths of 8 characters or more.


- Each MMBasic variable takes ~64 bytes in the variable table.
- Most of this is used by the name, type, dimensions, etc.
- 8 of these bytes are used for storage, enough for a 64-bit FLOAT, INTEGER, a very short string (7/8 chars? - but not on Micromites or currently MMB4L) or a pointer into the heap for a larger string or array.
- Space on the heap is always allocated in 256 byte pages ... hence a larger string always taking 256 bytes and the minimum allocation for an array being 256 bytes.

Best wishes,

Tom