(Internal) IDL analog of FORTRAN's "EQUIVALENCE" statement
Anonym
This Help Article discusses a way to simulate FORTRAN's EQUIVALENCE statement in IDL.
I can't find an IDL analog of the old FORTRAN "EQUIVALENCE" statement that allowed two different variables to be referenced at the same address. That is (and for example) is there a way to equivalence an unsigned double precision (ULL) to an an eight element byte array and take advantage of the properties of each. How can I accomplish this in IDL?
You can simulate Equivalence using IDL's BYTE conversion:
>IDL> x=!dpi
>IDL> print, x
> 3.1415927
>IDL> y=byte(x, 0, 8)
>IDL> print, y
> 24 45 68 84 251 33 9 64
>IDL> print, byte(x, 3)
> 84