HP 48GX - Store Coordinates in a List
04-03-2021, 02:25 PM
Post: #10
 BruceH Senior Member Posts: 510 Joined: Dec 2013
RE: HP 48GX - Store Coordinates in a List
(04-01-2021 09:21 PM)MNH Wrote:
(03-31-2021 09:27 PM)BruceH Wrote:  Maybe I could do something like this after point # 100 is stored:
{100 100 {100 [5000 5000] "PROP COR"}}, where 100 is the starting index and 100 is the ending index.
What I meant by starting and ending indexes, is they are a way to keep track of the lowest point number in the list and how many elements are in the list. Since I don't need any empty lists in the list to act as placeholders, and there doesn't need to be any correspondence between the list elements and their position in the list, all that is irrelevant.

Ah, I see. Given the amount of code needed to check each new value against the lowest and highest and fiddle around updating the beginning of the list it is probably easier to just calculate the highest and lowest on demand and not try to track them at all. (An added benefit is that then you don't need a special "add point to list" routine.) The following example finds the lowest value:

Code:
2: {{100 [5000 5000] "PROP COR"} {77 [7000 7000] "PROP BCK"}} 1: << -> a b 'IFTE(a(1) < b(1), a, b)' >> STREAM

Just change the < to > in the IFTE statement to get the highest element from the list.
 « Next Oldest | Next Newest »

 Messages In This Thread HP 48GX - Store Coordinates in a List - MNH - 03-28-2021, 04:21 AM RE: HP 48GX - Store Coordinates in a List - Giuseppe Donnini - 03-28-2021, 12:25 PM RE: HP 48GX - Store Coordinates in a List - MNH - 04-01-2021, 09:00 PM RE: HP 48GX - Store Coordinates in a List - Joe Horn - 04-02-2021, 12:28 AM RE: HP 48GX - Store Coordinates in a List - Han - 03-28-2021, 09:08 PM RE: HP 48GX - Store Coordinates in a List - MNH - 03-30-2021, 10:44 PM RE: HP 48GX - Store Coordinates in a List - MNH - 04-02-2021, 01:27 AM RE: HP 48GX - Store Coordinates in a List - BruceH - 03-31-2021, 09:27 PM RE: HP 48GX - Store Coordinates in a List - MNH - 04-01-2021, 09:21 PM RE: HP 48GX - Store Coordinates in a List - BruceH - 04-03-2021 02:25 PM RE: HP 48GX - Store Coordinates in a List - Han - 04-13-2021, 07:44 AM RE: HP 48GX - Store Coordinates in a List - MNH - 04-13-2021, 11:00 PM RE: HP 48GX - Store Coordinates in a List - Han - 04-14-2021, 06:50 AM RE: HP 48GX - Store Coordinates in a List - MNH - 04-15-2021, 01:21 AM