Post Reply 
HP-48G local variables within subroutine
05-17-2023, 07:22 AM
Post: #5
RE: HP-48G local variables within subroutine
(05-17-2023 01:58 AM)FLISZT Wrote:  If this SUBRoutine is called by an other program then you have to use "compiled local variables".

There is no reason to use compiled local variables here.
If your subroutine was simply
DIVMUL « a b / b DUP * »
and you called it from another program that defined a and b, eg
MAIN « → a b 'DIVMUL' »
then you would need compiled local variables, because when creating DIVMUL, a and b are GLOBAL variables while when calling DIVMUL from MAIN they should be local.
So, create DIVMUL as
DIVMUL « ←a ←b / ←b DUP * »
and MAIN as
MAIN « → ←a ←b 'DIVMUL' »

Cheers, Werner

41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-48G local variables within subroutine - Werner - 05-17-2023 07:22 AM



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