Post Reply 
Indirect addressing in HP PPL. Is it possible?
01-10-2014, 07:02 AM
Post: #5
RE: Indirect addressing in HP PPL. Is it possible?
The following code

EXPORT SYMBOL1,WHATTYPE;
EXPORT test2()
BEGIN
LOCAL var1="why",varptr="SYMBOL1";
INPUT(varptr,"Variable Name","Varnam=","Enter the var name","A");// Key in SYMBOL1
TYPE(var1)▶WHATTYPE;
EXPR(varptr + ":=" + var1);// When var1 is a string, this line causes a syntax error when the program is Run but not during Check in Edit!
END;

produces these results

TYPE(var1)▶WHATTYPE stores the following:
var1 = 3.14 stores 0 and the program runs fine.
var1 = π (pi) stores 0 and the program runs fine.
var1 = "why" stores 2 and the program halts with a syntax error from line EXPR(varptr + ":=" + var1); even though the Check function in Edit reports no errors!

Happy coding and may you see ' i No errors in the program ' with every compilation.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Indirect addressing in HP PPL. Is it possible? - veeblefester - 01-10-2014 07:02 AM



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