Post Reply 
HP49-50G: help for recursive
02-06-2024, 03:51 PM
Post: #12
RE: HP49-50G: help for recursive
(02-06-2024 01:29 PM)Gil Wrote:  I want to have max =x, yes, but
with the following 2 conditions:

- only for the first initial input value of x (afterwards, x is tranformed to a new x at each recursive loop)
- and only in the THEN condition for x was fulfilled before (if first IF test never gave THEN once, then max should not exist)

Apologies, my suggestion was based on the small snippet you showed, not as a result of studying the previous posts. Smile

A quick perusal showed me that I'm not likely to understand what you're actually trying to solve here with the limited time that I can apply to it at present. I'll just make a couple of general observations:
  • Compiled locals only make sense to use if you want to reference a local from a program that doesn't also contain that local's instantiation (-> command). Otherwise just create a normal local, perhaps at a higher scope level within that same program.
  • Instead of checking for the existence of the local variable, could you STO 0 into it (before the first recursive call) to imply that no value has yet been stored? If so, it would simplify the check by allowing you to treat max as a boolean as well as the max x value. "IF max THEN...ELSE...END" would process the ELSE clause iff max=0, otherwise the THEN clause applies. That obviously wouldn't work if max=0 could occur with the normal processing of x values. I honestly don't know if that is appropriate here, though.
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: 1 Guest(s)