Post Reply 
global variables HP-PPL
02-24-2017, 08:04 PM (This post was last modified: 02-24-2017 08:05 PM by compsystems.)
Post: #1
global variables HP-PPL
Hello if you define global variables without export, they are not displayed in the menu VAR or MEM, but if they exist, you can check it by executing more than once the next program

PHP Code:
x:=0;
y:=0;
EXPORT inputv0()
BEGIN
 
//x:=5;
 
print();
 print(
"text1"); wait;
 
input);
 print(
"text2"); wait;
 
input);
 print(
"text3"); wait;
END


Now if you define from the historal view

x: = 9; y = 8; And executes the previous program these values are not called by input

This shows that there are two types of global variables, one visible and one hidden,
Is this good or not?
Find all posts by this user
Quote this message in a reply
02-24-2017, 08:26 PM
Post: #2
RE: global variables HP-PPL
It is neither good nor bad. You just need to be aware of the scope of the variables and which has higher priority. It is no different than the following example:

Code:
x:=0;

export myprogram()
begin
  local x;
  x:=2
end;

myprogram() has a local variable named x that has higher priority than the x declared outside of myprogram().

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 




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