Post Reply 
What Am I Missing (HP-71B)
11-04-2014, 01:01 AM
Post: #9
RE: What Am I Missing (HP-71B)
(11-03-2014 11:51 PM)Sylvain Cote Wrote:  
(11-03-2014 10:21 PM)Les Bell Wrote:  1) The need to pass arrays by reference, and the consequent need to use a subprogram with an output parameter, and

In my example all variables where passed by reference.
Yes, I spotted that - what I meant was that, because arrays can only be passed by reference (p.206 of the Owner's Manual), and a user-defined function can only take simple variables as arguments (bottom of p. 218), it's necessary to use a subprogram, rather than a UDF. Trying to enter a UDF with an array as a parameter gives an "Invalid var" error. I'm not sure why a UDF is different from a subprogram in this respect, but I can live with it.
(11-03-2014 11:51 PM)Sylvain Cote Wrote:  Here is another example ...

10 R1=0 @ CALL SBT(R1) ! pass by ref
20 R2=0 @ CALL SBT((R2)) ! pass by val
30 DISP R1;R2 ! shows 10 0
40 SUB SBT(Z) @ Z=10 @ END SUB
Nice little demo - thanks!
(11-03-2014 11:51 PM)Sylvain Cote Wrote:  
(11-03-2014 10:21 PM)Les Bell Wrote:  2) The fact that DEF FN doesn't allow keyboard execution, only use as a program statement (that's why my simple non-array example was failing).
... does the UDF exist only within the scope of the program that defines it?
No UDF are local and can only be called inside the program file they reside.

That's what I figured; it would nice to have UDF's that were callable in CALC mode, but then, it would nice to have multi-letter variable and function names, so one could have more UDF's. Sigh. I guess what I'm saying is: I would love to have a Python-powered 71. . .

Thanks for your help with this!

--- Les
[http://www.lesbell.com.au]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
What Am I Missing (HP-71B) - Les Bell - 11-03-2014, 04:53 AM
RE: What Am I Missing (HP-71B) - Les Bell - 11-03-2014, 10:45 AM
RE: What Am I Missing (HP-71B) - cruff - 11-03-2014, 01:41 PM
RE: What Am I Missing (HP-71B) - Les Bell - 11-03-2014, 10:21 PM
RE: What Am I Missing (HP-71B) - Les Bell - 11-04-2014 01:01 AM
RE: What Am I Missing (HP-71B) - Joe Horn - 11-05-2014, 05:25 AM
RE: What Am I Missing (HP-71B) - Les Bell - 11-05-2014, 07:24 AM



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