Post Reply 
What Am I Missing (HP-71B)
11-03-2014, 02:03 PM
Post: #5
RE: What Am I Missing (HP-71B)
(11-03-2014 10:45 AM)Les Bell Wrote:  Yes, the real problem is the "Illegal context" error messages on what looks like just about the simplest DEF FN examples. I must be overlooking something very obvious, but I can't think what. . .

I have entered your example and I do not get the illegal context message but I do get a parameter mismatch thought.

I did some reading and experimentations, this is my finding ...
- FN parameters are passed by values
- FN can access global variables
- FN local variables mask global variables
- FN parameters only accept string and simple numeric variables (no numeric array)

so the following works

10 OPTION BASE 0
20 DIM A(1), B(1)
30 A(0)=4 @ A(1)=4 @ B(0)=5 @ B(1)=4
40 DISP FND;FNE(0,1);FNF(A(0),B(0),A(1),B(1))
100 DEF FND=A(0)*B(0)+A(1)*B(1)
110 DEF FNE(I1,I2)=A(I1)*B(I1)+A(I2)*B(I2)
110 DEF FNF(V1,V2,V3,V4)=V1*V2+V3*V4

If I find a way to pass an array I will post it.

Best regards,

Sylvain
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) - Sylvain Cote - 11-03-2014 02:03 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)