warning: (all(part1))(part2) = part2*0. [message #11882] |
Thu, 04 June 1998 00:00  |
R. Bauer
Messages: 137 Registered: November 1996
|
Senior Member |
|
|
This will gave an error like:
print,(all(part1))(part2)
0.00000 1.00000 2.00000
% Temporary variables are still checked out - cleaning up...
I know there are many solutions to get around of this malfunctional
code.
I was really surprising me that's it gaves this message.
PRO ind_err
all = findgen(100)
part1 = findgen(10)
part2 = findgen(3)
(all(part1))(part2) = part2*0.
print,(all(part1))(part2)
END
--
R.Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
|
|
|
Re: warning: (all(part1))(part2) = part2*0. [message #11970 is a reply to message #11882] |
Fri, 05 June 1998 00:00  |
R. Bauer
Messages: 137 Registered: November 1996
|
Senior Member |
|
|
Stein Vidar Hagfors Haugan wrote:
> R. Bauer wrote:
>
>> (all(part1))(part2) = part2*0.
>
> What you're doing here is to assign values to parts of a
> temporary value, almost as if you're saying
>
> 5*all(part1) = 1
>
> since (all(part1)) is a temporary value (actually, an rvalue)
> like any other expression.
>
> I think the error here is that IDL's compiler does not protest,
> but instead generates code (seemingly) to do assignments to
> a temporary value.
>
On idl 4 the compiler is protesting if something like above is defined.I
like to have these feature back again.
Are there other differences known in compiler errors which won't be
detected itself by idl 5.x ?
> What you should do (with the intended (?) effect) is:
>
> all(part1(part2)) = part2*0
We have done it in the same way.
--
R.Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
|
|
|
Re: warning: (all(part1))(part2) = part2*0. [message #11971 is a reply to message #11882] |
Fri, 05 June 1998 00:00  |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
R. Bauer wrote:
> (all(part1))(part2) = part2*0.
What you're doing here is to assign values to parts of a
temporary value, almost as if you're saying
5*all(part1) = 1
since (all(part1)) is a temporary value (actually, an rvalue)
like any other expression.
I think the error here is that IDL's compiler does not protest,
but instead generates code (seemingly) to do assignments to
a temporary value.
What you should do (with the intended (?) effect) is:
all(part1(part2)) = part2*0
Regards,
Stein Vidar
|
|
|