Post Reply 
Program local variables issue
02-10-2020, 11:07 AM (This post was last modified: 02-10-2020 11:21 AM by Carlos295pz.)
Post: #4
RE: Program local variables issue
(02-10-2020 02:25 AM)DrDarius Wrote:  I am assuming that the goal of this structure was to create variables that had scope limited to the module (equivalent of a static global variable in c/c++).

HP PPL is simpler than that, I really like it as a language. Any variable outside a function, either LOCAL or EXPORT, is persistent as long as a recompile is not performed, therefore they will not be efficient to save changes, but in order to be able to use them in other functions, HP PPL forces to use them since there is no passing of arguments by reference (a bit annoying), but with a little order everything can be happiness. The user manual has a section that explains HP PPL, read it before creating great confusion.


(02-10-2020 02:25 AM)DrDarius Wrote:  It is my understanding that the variables, as locals, should be destroyed the very moment the program terminates.

Outside of any function, every variable is global, and the point of LOCAL and EXPORT is for a visibility change for the calculator. LOCAL can be omitted only outside the program, let's say they are local to the compilation (checkmate). Regarding visibility, they are not visible but still accessible through ProgramName.LocalVariableName

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Program local variables issue - DrDarius - 02-10-2020, 02:25 AM
RE: Program local variables issue - Carlos295pz - 02-10-2020 11:07 AM



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