[futurebasic] Re: [FB] [FB3] passing.... uh.... vars

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1999 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Wed, 1 Dec 1999 10:57:11 +1300
>>I'm only getting one BEEP in the below example.

<snip>

>Limit the number of parameters passed to a function to 7.
>
>Best,
>
>-STAZ    ~)~


Whew! What a throwaway line!  The message arrived just as I was puzzling
why a program converted from FBII worked in 68K but not in PPC. It provided
the solution: two of my FNs had 9 parameters. On investigating, it seems
that more than 7 parameters is always OK in 68K and sometimes but _not_
always in PPC. The governing rules are unclear (as well as being
undocumented).

'------------------FB3.1.1f----------------------
local fn Test9Params(a1,a2,a3,a4,a5,a6,a7,a8,a9)' <-- OK in 68K and PPC
end fn=a1+a2+a3+a4+a5+a6+a7+a8+a9

local fn Test9Params2(a1#,a2,a3,a4,a5,a6,a7,a8,a9)' <-- wrong in PPC
end fn=a1#+a2+a3+a4+a5+a6+a7+a8+a9

local fn Test9Params3(a1,a2,a3,a4,a5,a6,a7,a8,a9#)' <-- wrong in PPC
end fn=a1+a2+a3+a4+a5+a6+a7+a8+a9#

local fn Test8Params(a1#,a2#,a3#,a4#,a5#,a6#,a7#,a8#)' <-- OK in 68K and PPC
end fn=a1+a2+a3+a4+a5+a6+a7+a8

window 1
print "Should be 45"
print fn Test9Params (1,2,3,4,5,6,7,8,9)
print fn Test9Params2 (1.0,2,3,4,5,6,7,8,9)
print fn Test9Params3 (1,2,3,4,5,6,7,8,9.0)
print fn Test8Params (2.0,3.0,4.0,5.0,6.0,7.0,8.0,10.0)
do: until fn button
'-------------------------------------------------

Can we please have a more formal statement of this extremely important
limitation?
It should also be fully documented in the Reference Manual.

The compiler should flag an error if the limitation is exceeded. FN
Test9Params2 and FN Test9Params3 compile OK but don't work in PPC, an
unhappy state of affairs.

Robert P.