06-08-2024, 08:46 PM
And there's one thing to definitely keep in mind when trying to track memory so closely, @Dimster -- it's impossible once you add this one simple line of code:
You've now decided to turn control over to the end user and let them enter something into your program. Do they enter in a 5-byte name? "STEVE" Or do they enter in their complete biography? "Back in 1980, I was first introduced to the World of Steve!! And let me say, STEVE IS AMAZING!! Oh my gosh! There's just not enough amazingly astouding perfect words to describe the awesomeness that is STEVE!! Wr all wish we could be STEVE!! Even though I *am* a STEVE, I still *wish* I could be even more a STEVE! Just call me Steve-THE STEVE-Steven_steve!!!"........
Hard to track memory usage when that user string might be anywhere from 0-bytes (they just hit enter and skipped it), to 2GB worth of garbage.
If "OUT OF MEMORY" is ever a real concern for your stuff, remember to always write your code with a hard limit on how large a string can possibly be.
Code: (Select All)
INPUT a$
You've now decided to turn control over to the end user and let them enter something into your program. Do they enter in a 5-byte name? "STEVE" Or do they enter in their complete biography? "Back in 1980, I was first introduced to the World of Steve!! And let me say, STEVE IS AMAZING!! Oh my gosh! There's just not enough amazingly astouding perfect words to describe the awesomeness that is STEVE!! Wr all wish we could be STEVE!! Even though I *am* a STEVE, I still *wish* I could be even more a STEVE! Just call me Steve-THE STEVE-Steven_steve!!!"........
Hard to track memory usage when that user string might be anywhere from 0-bytes (they just hit enter and skipped it), to 2GB worth of garbage.
If "OUT OF MEMORY" is ever a real concern for your stuff, remember to always write your code with a hard limit on how large a string can possibly be.