C
Curbie
Are all variables passes by C to a function (or sub), passed ByRef? As
an example, this routine seems to want to change the value of the
passed variable "poa" in the calling routine?
Thanks,
Curbie
/* Function declaration */
float transpoa( float poa,float dn,float inc );
float transpoa( float poa,float dn,float inc )
{
int i;
float
b0=1.0,b1=-2.438e-3,b2=3.103e-4,b3=-1.246e-5,b4=2.112e-7,
b5=-1.359e-9,x,DTOR=0.017453293;
inc = inc/DTOR;
if( inc > 50.0 && inc < 90.0 )
{
x = b0 + b1*inc + b2*inc*inc + b3*inc*inc*inc +
b4*inc*inc*inc*inc
+ b5*inc*inc*inc*inc*inc;
poa = poa - ( 1.0 - x )*dn*cos(inc*DTOR);
if( poa < 0.0 )
poa = 0.0;
}
return(poa);
}
an example, this routine seems to want to change the value of the
passed variable "poa" in the calling routine?
Thanks,
Curbie
/* Function declaration */
float transpoa( float poa,float dn,float inc );
float transpoa( float poa,float dn,float inc )
{
int i;
float
b0=1.0,b1=-2.438e-3,b2=3.103e-4,b3=-1.246e-5,b4=2.112e-7,
b5=-1.359e-9,x,DTOR=0.017453293;
inc = inc/DTOR;
if( inc > 50.0 && inc < 90.0 )
{
x = b0 + b1*inc + b2*inc*inc + b3*inc*inc*inc +
b4*inc*inc*inc*inc
+ b5*inc*inc*inc*inc*inc;
poa = poa - ( 1.0 - x )*dn*cos(inc*DTOR);
if( poa < 0.0 )
poa = 0.0;
}
return(poa);
}