[Coco] Back to DEF FN
Rogelio Perea
os9dude at gmail.com
Mon Jan 27 23:07:51 EST 2014
On Mon, Jan 27 2014, William Astle wrote:
Actually, it's not working. Try using something other than N1 and N2 in
> your input and print statements. Say use X and Y.
>
Your note prompted a little bit more testing on this end. Rewrote the MOD
routine as:
10 DEF FNRE(A)=X-INT(X/Y)*Y
20 CLS
30 INPUT"NUMBER 1";X
40 INPUT"NUMBER 2";Y
50 PRINT
60 PRINT X;"MOD";Y;"IS;"FNRE(Z)
70 PRINT
80 GOTO 30
and it works. So only a dummy variable is needed to define the function, it
can be defined with one and called using another. To this day I held the
idea that on the function side one had to stick to the variables
established in the DEF FN side... so I did learn something new today.
More information about the Coco
mailing list