On Mon, 28 Jul 2008 16:12:18 -0500:

> as I understand it those shareable local variables
> [names beginning with left-arrow character '\<-']
> only exist while the program that creates them is running
> so that the creating program must be halted
> with those variables still in existence
> and only ended after those variables are done with.


The scope of local variables created with \->
is within the single object (program or algebraic)
following the \-> operator;
it could be a very long program, however,
perhaps even involving a loop which doesn't end
until some special condition occurs,
or it might contain commands
which either halt or wait for input
(e.g. HALT, INPUT, PROMPT, CHOOSE, INFORM)

As to whether you need to halt, that depends only
upon whether you have finished using the variables
by the time that the one object is finished executing.

MENU and TMENU commands set up menus but do not halt,
so typical simple programs which simply create menus
often do exit, leaving the menu on the display,
but no longer executing the program,
in which case a HALT (as in one previous example)
might be useful.

The HP49/50 series also has a new CAS command: LOCAL
for creating (and optionally assigning values to)
local variables; the example given in the AUR,
if I should dare to attempt to express it
in RPN mode instead, would seem to be:

{ \<-A \<-B=2 } LOCAL

For which the AUR predicts this result:

"Create local variables \<-A and \<-B
and store the values 0 in the first and 2 in the second."

Unfortunately, the above did not create _any_ local variables
for me, a subsequent \<-A producing only
"Error: Undefined Local Name"

But when I performed { \<-A \<-B=2 } LOCAL HALT
I then found that local variable \<-A contained 0,
just as the AUR predicts.

However, I did not find that variable '\<-B' contained 2.
In fact, there was no local variable named '\<-B'
Guess what there was? Yep, a local variable named '\<-B=2'
(where "=2" is just part of the variable's name!)
and value 0 stored into that, rather than the AUR's prediction.

Oh well, I bet that what the AUR really meant to say was:

{ \<-A '\<-B=2' } LOCAL (and maybe also HALT)

Ah, that's much better!

Another interesting thing is that after once using
\<< LOCAL HALT \>> EVAL and then later CONT
(terminating the program), these two local variables
continued to exist (with RCL still recalling 0),
which is just fine, except that it doesn't answer
"what is the scope of variables created by a LOCAL command ?"

So, I would forget about this LOCAL command
(which demands local variable names anyway as arguments),
and stick with the older, universal syntax (all HP48/49/50):
1 2 3 \-> x y z \<< one program or algebraic object \>>
which is perfectly predictable and reliable,
as well creating local variables having any names one wants.

Postscript:

The keystroke sequence I gave for entering a left-arrow character
works only on an original HP48; on the HP49/50 series,
there seems to be _no_ keyboard-entry sequence for this character
(you have to use the CHARS application,
or else make a "user key" assignment of your own).

All this slows down the use of LOCAL so much
that there is a very clear contrast between LOCAL
and, say, an "EXPRESS" mode of programming;
gee, I wonder whether it was planned that way?

[r->] [OFF]