Skip to main content
added 82 characters in body
Source Link
tofro
  • 39.1k
  • 4
  • 103
  • 198

Applesoft BASIC has a CLEAR command to clear the variable area. "Clearing", however, can mean either removing or zeroing the variable. (And CLEAR can obviously not wipe a specific variable only - it's all or nothing) According to the AppleSoft manual, CLEAR

Zeroes all variables and stings. Resets pointers and stacks.

which doesn't really tell us much, even if the last sentence - somewhat contradicting to the first - seems to indicate the variable area is really emptied, rather than zeroed.

A quick glance into the re-engineered AppleSoft source code seems to indicate the variable area is actually wiped rather than "zeroed" - CLEAR calls a routine SETPTRS, which is also called on NEW and RUN so basically is creating a "blank plate".

Applesoft BASIC has a CLEAR command to clear the variable area. "Clearing", however, can mean either removing or zeroing the variable. According to the AppleSoft manual, CLEAR

Zeroes all variables and stings. Resets pointers and stacks.

which doesn't really tell us much, even if the last sentence - somewhat contradicting to the first - seems to indicate the variable area is really emptied, rather than zeroed.

A quick glance into the re-engineered AppleSoft source code seems to indicate the variable area is actually wiped rather than "zeroed" - CLEAR calls a routine SETPTRS, which is also called on NEW and RUN so basically is creating a "blank plate".

Applesoft BASIC has a CLEAR command to clear the variable area. "Clearing", however, can mean either removing or zeroing the variable. (And CLEAR can obviously not wipe a specific variable only - it's all or nothing) According to the AppleSoft manual, CLEAR

Zeroes all variables and stings. Resets pointers and stacks.

which doesn't really tell us much, even if the last sentence - somewhat contradicting to the first - seems to indicate the variable area is really emptied, rather than zeroed.

A quick glance into the re-engineered AppleSoft source code seems to indicate the variable area is actually wiped rather than "zeroed" - CLEAR calls a routine SETPTRS, which is also called on NEW and RUN so basically is creating a "blank plate".

Source Link
tofro
  • 39.1k
  • 4
  • 103
  • 198

Applesoft BASIC has a CLEAR command to clear the variable area. "Clearing", however, can mean either removing or zeroing the variable. According to the AppleSoft manual, CLEAR

Zeroes all variables and stings. Resets pointers and stacks.

which doesn't really tell us much, even if the last sentence - somewhat contradicting to the first - seems to indicate the variable area is really emptied, rather than zeroed.

A quick glance into the re-engineered AppleSoft source code seems to indicate the variable area is actually wiped rather than "zeroed" - CLEAR calls a routine SETPTRS, which is also called on NEW and RUN so basically is creating a "blank plate".