On Mar 8, 7:27 pm, David Fanning <n...@dfanning.com> wrote:
> yp writes:
>> In my previous example, "Operation" = int_LUT and it does not change
>> any of the variables during execution or after. I don't suspect that
>> anything wrong happening inside "int_LUT". For any one case and for
>> same combination of the arguments:- if I run the code for several
>> times, I get same and consistent result each time. But when I switch
>> between passing the argument by value and by variable, I see the
>> discrepancy. Weird!
>
> Extremely weird!
>
> Just to humor me, could you please subscript your A, B, and F
> variables, so they are passed by value rather than by reference:
>
> IDL> Operation, a[0], b[0], c, d, e, f[0], result
>
> and tell us what happens both ways then? What if all parameters
> are passed by value?
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
David,
result1=(result2=(result3=(dblarr(1))))
int_LUT,wave[0],1,0.0D,0.0D,0.0D,chl[0],result1
int_LUT,wave[0],1,null,null,null,chl[0],result2
int_LUT,412.5,1,0.0D,0.0D,0.0D,0.03D,result3
print,'RESULT 1: ', double(result1[*])
print,'RESULT 3: ', double(result2[*])
print,'RESULT 3: ', double(result3[*])
RESULT 1: 0.090099994
RESULT 3: 0.090071241
RESULT 3: 0.090099994
|