Post Reply 
Function parameters
02-27-2019, 10:15 AM (This post was last modified: 02-27-2019 10:16 AM by Oulan.)
Post: #1
Function parameters
While reading the user guide, it seems that the parameters of HP PPL
function are passed by value. Is there a way to pass them by reference ?

--see PPL program --
Code:

DOIT(X)
  25->X(1)
END;
EXPORT test()
BEGIN
  LOCAL a;
  {1,2,3}->a;
  PRINT(a);
  DOIT(a);
  PRINT(a);
END;

As python mode is not described in this guide, is "pythonesque"
function call use call by reference as in real python ?

-- see real python program --
Code:

def doit(x):
    x[1] = 45
a = [1,2,3]
print(a)
doit(a)
print(a)
Find all posts by this user
Quote this message in a reply
02-27-2019, 04:24 PM
Post: #2
RE: Function parameters
(02-27-2019 10:15 AM)Oulan Wrote:  While reading the user guide, it seems that the parameters of HP PPL
function are passed by value. Is there a way to pass them by reference ?

No, you'll have to make the variables global. I'd really like an option to pass by reference as well but there's little to no chance of that happening.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 




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