![]() |
Forum Index : Microcontroller and PC projects : List variables
Author | Message | ||||
Mark Regular Member ![]() Joined: 26/11/2022 Location: United StatesPosts: 85 |
The memory commands may show variables in memory. I assume those are variables created from the command prompt as well as global variables created in a program. Is it possible to list those variables? |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
I am not up-to-date with any changes to the MEMORY or INFO commands that might provide vairable name lists but I did a bit of work on this a year or two back. Take a look at this artcle for discussion on the structure of the vairable headers and how to get at them. It should be quite straightforward to adapt the process in that code to simply list out the variables. A couple of words of caution: *** there is no mechanism exposed to MMBasic to determine where is the end of the varable descriptors so you have to choose a figure and go with it. Each descriptor is 64 bytes long so your number needs to be a multiple of that e.g. 2048/64 will list 32 "variable name" but there is no guarantee that some of thse won't be garbage *** locals and statics can have the same names as globals but are differentiated by having a "level" value... I don't know where this is in the descriptor or how to use it Edited 2024-12-28 20:35 by CaptainBoing |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10244 |
The article is out-of-date as the PicoMite variants use a hash table for variables. It isn't possible to list them - you created them so you should know what you created ![]() |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2170 |
I suspected as much - the micromite is the target platform for that code Edited 2024-12-28 20:38 by CaptainBoing |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |