Post Reply 
HP-50g Local variable and Global variable confusion
04-08-2017, 09:28 PM (This post was last modified: 04-08-2017 09:38 PM by TravisE.)
Post: #3
RE: HP-50g Local variable and Global variable confusion
^ Local variables can exist during interactive operation when a program executes HALT within a local variable block. However, I don't know of a built-in way to display a list of current local variables. At any rate, they will be automatically destroyed once all suspended programs are allowed to continue to completion or the KILL command is executed.

One way to refer to local variables in an expression (this works on the 50g; I don't recall on which model this feature was first introduced) is to name the variable starting with a left-arrow (←) character. The editor will always compile variables with such names to refer to local variables, whether or not they actually exist at compile time. The following, for instance, should return 10 when executed:

Code:
« '2*←X' 'F' STO
  5 → ←X « F EVAL »
»
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP-50g Local variable and Global variable confusion - TravisE - 04-08-2017 09:28 PM



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