Post Reply 
HP49-50G: help for recursive
02-06-2024, 01:14 PM
Post: #10
RE: HP49-50G: help for recursive
(02-06-2024 11:57 AM)Gil Wrote:  « -> x
«
IFERR '<-max' RCL
THEN x ->
<-max
«
»

ELSE DROP
END <-max
»
»

What I then need is the <—max variable outside the IF... THEN... END structure.

Why not simply create <-max at the same time you create x? It appears that you initialize the value of <-max to be whatever value x has, so I would think you could change the first line in your code to:
« DUP -> x <-max
...


That way the scope of <-max is now the same as x, which I believe may be what you want here. This keeps you from having to test if <-max exists, since it is now guaranteed to exist everywhere that x exists.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP49-50G: help for recursive - Gil - 02-02-2024, 12:46 PM
RE: HP49-50G: help for recursive - Gil - 02-02-2024, 01:52 PM
RE: HP49-50G: help for recursive - Gil - 02-02-2024, 06:13 PM
RE: HP49-50G: help for recursive - Gil - 02-03-2024, 10:19 AM
RE: HP49-50G: help for recursive - Gil - 02-04-2024, 12:06 PM
RE: HP49-50G: help for recursive - Gil - 02-06-2024, 11:57 AM
RE: HP49-50G: help for recursive - DavidM - 02-06-2024 01:14 PM
RE: HP49-50G: help for recursive - Gil - 02-06-2024, 01:29 PM
RE: HP49-50G: help for recursive - DavidM - 02-06-2024, 03:51 PM
RE: HP49-50G: help for recursive - Gil - 02-06-2024, 05:48 PM
RE: HP49-50G: help for recursive - DavidM - 02-06-2024, 08:51 PM
RE: HP49-50G: help for recursive - Gil - 02-06-2024, 08:53 PM



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