comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Union in IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Union in IDL? [message #16257] Mon, 12 July 1999 00:00
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
Guido Lemoine wrote:

> Is there a way to convert a bytarr of length N_TYPE to TYPE?
>
> For instance, if TYPE = DOUBLE (so, N_TYPE=8), how do I convert the
> bytarr(8) to DOUBLE. I am looking for something like the UNION
> construction in C (i.e. which allows you, more or less, to reference a
> piece of memory as more then one type).
[...]
> I need to convert these back to doubles (but double(BYTARR) doesn't
> work, of course...).

That's right, but double(byte_array,0) does the trick.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Farewell USA!
Next Topic: Re: 3D Graphics Question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 12:56:44 PDT 2025

Total time taken to generate the page: 1.20029 seconds