Post Reply 
Confused about LOCAL....
11-16-2017, 05:57 AM
Post: #4
RE: Confused about LOCAL....
Hello,

LOCAL are local to a function (or a block within a function).
LOCAL have a limited lifetime (the execution time of the block in which they are. A function being a block).
LOCAL also have "stacking ability". If a block calls itself (or another block that declares a LOCAL with the same name, then 2 variables with the same name will (temporary) exist (with the last one being the only visible one).

They are not LOCAL to a program.
Variables declared outside of a funciton in a program are globals (because they last for as long as the program lasts, even if it does not execute. They are reset when the program is recompiled). But they will keep their values between 2 calls of functions in the program.
Program globals can be access from outside of the program using their fully qualified name (program_name.variable_name).
program global variables defined with an EXPORT keyword can be accessed from outside the program directly without a fully qualified name.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Confused about LOCAL.... - webmasterpdx - 11-15-2017, 06:19 AM
RE: Confused about LOCAL.... - Dirk.nl - 11-15-2017, 12:18 PM
RE: Confused about LOCAL.... - cyrille de brébisson - 11-16-2017 05:57 AM
RE: Confused about LOCAL.... - Carlos295pz - 11-16-2017, 06:43 AM
RE: Confused about LOCAL.... - Carlos295pz - 11-16-2017, 06:55 AM
RE: Confused about LOCAL.... - Tim Wessman - 11-16-2017, 05:13 PM
RE: Confused about LOCAL.... - Han - 11-17-2017, 04:04 PM



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