pixelmischief Posted May 17, 2020 Share Posted May 17, 2020 I can't figure out how to tell BASIC to "forget" a string variable. Once I do, "DIM A$(10)", that seems to be permanent. A$ is tattooed until a cold boot. What can I do here? Quote Link to comment Share on other sites More sharing options...
pixelmischief Posted May 17, 2020 Author Share Posted May 17, 2020 (edited) Nevermind. A next RUN clears all of the string variables set at the READY prompt. Edited May 17, 2020 by pixelmischief 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 17, 2020 Share Posted May 17, 2020 CLR will work but you lose all your other variables as well so limited usefullness. Also you only have the 128 variable names, and even if you stop using one it'll still be taking up the entry in the name table. Though I can't say I've ever run out. But it can be freed up by LISTing then ENTERing your program back from a storage device. Generally if you have some work where you want a big string e.g. for supporting data setup or something you could do it early on then issue a CLR. Quote Link to comment Share on other sites More sharing options...
pixelmischief Posted May 17, 2020 Author Share Posted May 17, 2020 Thanks, my man! Quote Link to comment Share on other sites More sharing options...
Graham Dearsley Posted May 18, 2020 Share Posted May 18, 2020 You may also want to set the length that BASIC has stored for a string back to zero, at some point, without CLRing the string and you can do that with A$="". The LEN function will then report the length as zero 1 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted June 10, 2020 Share Posted June 10, 2020 CLR. Quote Link to comment Share on other sites More sharing options...
JamesD Posted June 10, 2020 Share Posted June 10, 2020 (edited) IDK about Atari BASIC, but on Microsoft BASIC, you could reserve a specified amount of memory, and you could use PEEK and POKE to access data in that memory. This was used on the TRS-80 for a dungeon crawler so it could go between the town (tavern?), and exploration modules... Temple of Apshai maybe? Edited June 10, 2020 by JamesD Quote Link to comment Share on other sites More sharing options...
+David_P Posted June 10, 2020 Share Posted June 10, 2020 There are techniques to reserve memory (sometimes you need page aligned space) as well as using strings. The ADR command gives the address of the string, which permits manipulation of data within the string via PEEK and POKE, as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.