Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DAY 022: CLEAR
#2
Cannot find any page that would support my arguments here, which is a shame.

"CLEAR" did lots more especially on Tandy computers. On the Color Computer it had to be used for "string space". That's why in Q(uick)BASIC the first parameter is never put down. When the Color Computer was turned on and ready to go with BASIC, it allowed only 200 characters for the storage of any number of string variables. Needed "CLEAR 1000" as the first line in the program if the programmer were sure no more than 1000 characters were needed for strings. LOL QB64 could be run on a computer with as much as 1TB RAM for a single string variable, but not the Color Computer. In fact the amount of string space ate into the space available for numeric variables and for code. To exacerbate the issue, the second parameter for that computer's statement was devised called "memend". This was necessary to "protect" a section of memory from any intrusion by the code. It was necessary for graphics but it required too much memory on a 16KB RAM computer to be sensible. So I have revealed why the first two parameters for "CLEAR" cannot be given in later BASIC's that support this keyword, and must use at least two commas always as placeholders.

Now I don't remember what the third parameter was for... until I finished writing this paragraph! The fourth one was recognized by the BASICA version that came with the Tandy1000, which was to allocate graphics memory for its exclusive graphics modes. This was necessary for "SCREEN 4" and the few other ones that Q(uick)BASIC didn't let you choose, and I couldn't choose them neither on my Tandy1000RLX because that computer came instead with VGA.

I think QuickBASIC and BASIC PDS recognized the third parameter. It was to set "stack space". C programmers for long years are very familiar with that one; stack overflow could cause some of them to cry. It had something to do with subprograms and functions written by the user. One couldn't declare too many local variables and had to keep arrays small unless they were declared with "DIM SHARED".

I learned in a children's book about BASIC programming that "DIM" had to be used instead of "CLEAR" to allocate disk space for strings on one Atari line of computers, before the ST gained fame.

Using "CLEAR" in a QB64(PE) program is simply bad practice, just don't.
Reply


Messages In This Thread
DAY 022: CLEAR - by Pete - 12-03-2022, 12:47 AM
RE: DAY 022: CLEAR - by mnrvovrfc - 12-03-2022, 02:44 AM
RE: DAY 022: CLEAR - by Pete - 12-03-2022, 02:52 AM
RE: DAY 022: CLEAR - by bplus - 12-03-2022, 04:50 AM



Users browsing this thread: 1 Guest(s)