Post Reply 
Indirect addressing....
09-09-2017, 04:32 AM
Post: #1
Indirect addressing....
The input command takes arguments of the form {varname, ....}, where varname is a variable name. Then the function is able to assign values to that variable.
How can I create a function that can take such an argument. I understand how, with the TYPE and SIZE functions, the input function can process all the other arguments, but I can't figure out how it's able to assign values to the variable names passed in the list.
The input function takes a list as it's argument and the variable name is in a sublist.
Anyone know how it does this and if this is even possible for a user's function to do?
Thx
-Donald
Find all posts by this user
Quote this message in a reply
09-10-2017, 12:49 AM
Post: #2
RE: Indirect addressing....
This is called pass arguments by value or reference, it is not possible to create such functions in HP PPL, but you can find ways to do it with EXPR.
Ejemplos en español: http://carlos-icg.blogspot.com/2017/07/h...Referencia

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
09-10-2017, 03:35 AM
Post: #3
RE: Indirect addressing....
Ya I know. I was hoping to avoid sending the values in by strings, but by reference instead.
Unfortunately HPPL doesn't support that. I was hoping there was some secret way of doing it :-)
Thx
-D
Find all posts by this user
Quote this message in a reply
09-10-2017, 03:38 AM
Post: #4
RE: Indirect addressing....
Thanks for all your help Carlos by the way. I'm only a recent Prime developer and don't know all the secret doors yet :-)
BTW, do you work for HP? You seem to have very good insight into the product.
Thanks again
-Donald
Find all posts by this user
Quote this message in a reply
09-10-2017, 03:43 AM
Post: #5
RE: Indirect addressing....
I do not work for HP, but let's say I know a lot about the HP PPL virtues as well as many in this forum.

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
09-10-2017, 03:52 AM
Post: #6
RE: Indirect addressing....
I see you are a civil engineer and those other apps are something to do with beams.
I'm an electronic engineer, but I've been developing software since I graduated in 1982. I've done a bit of everything but mostly embedded software.
Thanks again for all your help. I'm still interested in that doc.txt and how you got access to all the files (probably using AFiles no doubt) :-)
-Donald
Find all posts by this user
Quote this message in a reply
09-11-2017, 05:28 AM
Post: #7
RE: Indirect addressing....
Hello,

Actually, thinking about this, I think that I have put a workaround for this.

Functions like INPUT have a "no eval" property for the first parameter so that INPUT(var_name) works (because in this case, INPUT needs the varaible name, not the variable value).

However, the no-eval property can be overriden (if my memory serves me well) by placing an EVAL around the van-name...

meaning INPUT(eval(var-name)) will do an INPUT on the content of var-name, not on var-name itself!

try it, it might fix your problem!

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
09-11-2017, 05:55 AM
Post: #8
RE: Indirect addressing....
i want the no-eval part because i want the variable name....not the content...
Find all posts by this user
Quote this message in a reply
09-11-2017, 11:17 AM
Post: #9
RE: Indirect addressing....
(09-11-2017 05:55 AM)webmasterpdx Wrote:  i want the no-eval part because i want the variable name....not the content...

But if the content is another variable name...

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
09-11-2017, 12:48 PM
Post: #10
RE: Indirect addressing....
I'm basically writing my own version of the input function (I won't use the same name), but it takes as input, lets say for an input box/field for a numeric value, something like this is part of the input....
...
{XMin,[0],{15,30,0},
...
where XMin is a variable name. Now, I can pass in a string like "XMin" and use something like
expr(invar+":=4"); to assign values, but this is ugly, and I'd much rather pass in the variable without the quotes, like the current input command. The current input command was written in C/assembler as part of the firmware code. I don't have access to that, and have to write it in HPPL, so, I was hoping there was some trick whereby I could pass in the variable like the current input command by reference. That's all.
Thx
-Donald
Find all posts by this user
Quote this message in a reply
Post Reply 




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