[HP 35s] Clearing variables
03-01-2015, 11:08 PM (This post was last modified: 03-01-2015 11:09 PM by Dieter.)
Post: #6
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: [HP 35s] Clearing variables
(03-01-2015 10:58 PM)Tugdual Wrote:  Oh my Gosh, indeed!

Bingo!

(03-01-2015 10:58 PM)Tugdual Wrote:  And putting zero is the last variable systematically de-allocate it.
So you never can store zero in the last element of an array because when you recall it you have the message "INVALID (I)". What the heck is this logic!?

It's called dynamic memory allocation, and this feature has been discussed in this very thread, including a solution like storing a non-zero value in the first variable beyond the last one required. Take a look at the suggested code.

The 35s offers a vast amout of memory. It can store more or less equations as well as more or less programs, and so a varying amout of memory that is not used for these is still available. This memory is used for the indirect variables. With an otherwise "empty" calculator there may be 800+ variables. If there was a fixed amount of, say, 500 variables, memory for equations and programs was limited. So it's quite clever to use (and allocate) only the amount of memory that is actually used. This is done by storing a non-zero value in the last variable.

Type CLVARX 000 to clear all indirect variables (except var(0)). You get the maximum amount of memory for programs and equations. Now store 1 into var(20) and var(100). This allocates memory for variables 1 to 100. Store a zero in var(100) and this leaves var(0) to var(20) allocated. The memory previously used for var(21) to var(100) is freed and can be used for other purposes.

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread [HP 35s] Clearing variables - Tugdual - 03-01-2015, 06:00 PM RE: [HP 35s] Clearing variables - Dieter - 03-01-2015, 09:09 PM RE: [HP 35s] Clearing variables - Tugdual - 03-01-2015, 09:47 PM RE: [HP 35s] Clearing variables - Dieter - 03-01-2015, 09:58 PM RE: [HP 35s] Clearing variables - Tugdual - 03-01-2015, 10:58 PM RE: [HP 35s] Clearing variables - Dieter - 03-01-2015 11:08 PM RE: [HP 35s] Clearing variables - Tugdual - 03-01-2015, 11:13 PM

User(s) browsing this thread: 1 Guest(s)