Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 06:44 05 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MMBasic 5.3 wrinkle?

Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 06:29am 28 Apr 2017
Copy link to clipboard 
Print this post

This is MMBasic 5.3 on both MZ and MX processor.

The NEW command seems to clear variables but does not de-allocate the space.

What am I missing?





 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 309
Posted: 06:36am 28 Apr 2017
Copy link to clipboard 
Print this post

I believe you re-allocated memory when you printed the variable a to show it had been cleared. Try using MEMORY immediately after doing a NEW instead.

Unfortunately I don't have a 'mite handy to test with at the moment.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1985
Posted: 06:37am 28 Apr 2017
Copy link to clipboard 
Print this post

heh! you passed the test
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 06:39am 28 Apr 2017
Copy link to clipboard 
Print this post

  Justplayin said   I believe you re-allocated memory when you printed the variable a to show it had been cleared.


This is correct! It has thrown me a few times too

To see this affect - type a few more PRINT x statements (replacing x with different 'made up' variable names) and then type MEMORY again. You will see the variable count increase for each unique variable you just typed PRINT x for.

WW
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024