Program without using variables?
|
10-03-2023, 09:04 PM
Post: #1
|
|||
|
|||
Program without using variables?
I am going down a few rabbit holes at the moment and I am exploring the idea of how to take numbers from the stack and use them in a program without storing them to a variable.
Yes, I know about local variables -> a b /<< a b + />> and I use them a lot. The program I am writing now has six soft menu keys. 1 - 4 store a number from the stack into a variable. 5 executes the program. 6 cleans the variables from memory when I am done evaluating different numbers. My first thought was to use a list. I place a list on the stack and when I press soft menu keys 1-4 it would store that number in the list on the stack in the appropriate order. This worked well, minus having to have the list on the stack. Is there a different way to store variables without committing them to memory? HP48GX, HP42s and DM42. |
|||
10-04-2023, 02:39 AM
Post: #2
|
|||
|
|||
RE: Program without using variables?
argc, argv[ ] ?
Remember kids, "In a democracy, you get the government you deserve." |
|||
10-04-2023, 12:29 PM
Post: #3
|
|||
|
|||
RE: Program without using variables?
Try storing numbers in a matrix.
|
|||
10-04-2023, 05:53 PM
Post: #4
|
|||
|
|||
RE: Program without using variables?
Find CMAT on hpcalc.org.
"CMAT is an HP48 program for performing operations on columns of a matrix. CMAT iterates over each row of the matrix, treating the n columns of the matrix as if they were variables named C1, C2, ... Cn, or, optionally, as if they were named with user-specified names." |
|||
10-04-2023, 09:12 PM
Post: #5
|
|||
|
|||
RE: Program without using variables?
(10-04-2023 05:53 PM)MNH Wrote: Find CMAT on hpcalc.org. Does a matrix allow (x,y) points to be stored in one position? What do you use as a data collector these days? I used an HP48GX like most everyone in the early 2000s. I still have my gun and 48 with cards. HP48GX, HP42s and DM42. |
|||
10-04-2023, 10:26 PM
Post: #6
|
|||
|
|||
RE: Program without using variables? | |||
10-05-2023, 12:38 AM
Post: #7
|
|||
|
|||
RE: Program without using variables?
(10-04-2023 10:26 PM)John Keith Wrote:(10-04-2023 09:12 PM)DM48 Wrote: Does a matrix allow (x,y) points to be stored in one position? Fascinating! HP48GX, HP42s and DM42. |
|||
10-05-2023, 11:38 AM
Post: #8
|
|||
|
|||
RE: Program without using variables? | |||
10-05-2023, 11:47 AM
Post: #9
|
|||
|
|||
RE: Program without using variables? | |||
10-05-2023, 02:51 PM
Post: #10
|
|||
|
|||
RE: Program without using variables? | |||
10-07-2023, 02:26 AM
Post: #11
|
|||
|
|||
RE: Program without using variables? | |||
10-20-2023, 01:04 PM
Post: #12
|
|||
|
|||
RE: Program without using variables?
Quote:Is there a different way to store variables without committing them to memory?Keep in mind that the numbers are in memory whether they're on the stack or in a variable. The variable takes a little more space for the name and some overhead. What you're doing sounds to me like a classic example of what directories for are. Create a directory for the program to run in. Store the variables in that directory. I don't recommend putting them on the stack because the user might modify the stack between pressing the soft keys. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)