Post Reply 
HP PPL compiler big, nasty, hairy, smelly, creapy BUG!
01-10-2014, 09:59 AM (This post was last modified: 01-10-2014 10:35 AM by veeblefester.)
Post: #1
HP PPL compiler big, nasty, hairy, smelly, creapy BUG!
Thanks to Han we now know how to do indirect addressing on the HP Prime.

There is a bug in the HP PPL compiler that causes a syntax error during runtime but not during Edit Check.

This compilation error occurs in the code line EXPR(varptr + ":=" + var1);

Read ALL the comments in the code below.

With regard to Han, he either has some great inside connections to HP
or he is HP or he is the Grand Imperial Poobah of all things Prime.

I do not care which.

Many thanks to Han and the stuff between his ears.

See the thread "Indirect addressing in HP PPL. Is it possible?"

Code that brings about indirect addressing follows. Again, read ALL the comments.
Including the comments imbedded in the code.

// The following code performs indirect addressing if var1 is a real, integer or symbolic such as π (pi). Does not work if var1="string", you get a syntax error during 'Run' BUT NOT DURING 'Check' in Edit. Read the comments in the code lines for the work around by Han to this HP PPL compiler big, nasty, hairy, smelly, creapy BUG.
// The syntax error is caused by line EXPR(varptr + ":=" + var1);
// It is curious that the compiler is allowing this syntax during compilation but not allowing it during runtime.
EXPORT Indirect_Addressing()
LOCAL var1="why",varptr;
INPUT(varptr,"Variable Name","Varnam=","In quotes, enter the var name","A");// Key in "SYMBOL1".
TYPE(var1)▶WHATTYPE;// Even though TYPE == 2 (string)
IF TYPE(var1)==2 then var1:=STRING(var1); end;// this line is needed to prevent a syntax error
EXPR(varptr + ":=" + var1);// by this EXPR(varptr + ":=" + var1); line.

Han, thanks again for your help.

I hope that your efforts and contributions in HP's launch of the Prime are recognized by HP.

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
HP PPL compiler big, nasty, hairy, smelly, creapy BUG! - veeblefester - 01-10-2014 09:59 AM

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