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

Home » Public Forums » archive » Re: Can you do 'unions' with pv-wave?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Can you do 'unions' with pv-wave? [message #3176] Tue, 22 November 1994 07:22 Go to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
jgavin@mksol.dseg.ti.com (Jeffrey S. Gavin) writes:

> Is there a way to have a single variable viewed as multiple types, similar
> to the way unions work in C. For example:

(rest deleted for brevity)

You can always do type conversions on the fly. For example, if you read in a
100 bytes from a file (e.g. into B), and want to treat bytes 20-29 as ten short
integers, you can say

PRINT, FIX(B,20,10)

Where 20 is the starting point in the B array, and 10 is the number of values
to extract.

The same is true for the functions BYTE, LONG, FLOAT, DOUBLE, and COMPLEX. If
you want to extract strings, then you simply say something like

PRINT, STRING(B(30:35))

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: ** REQUEST ** for a list of well known bugs on SGI with prop' products
Next Topic: Re: Eigensystems in IDL

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

Current Time: Sun Oct 12 19:44:34 PDT 2025

Total time taken to generate the page: 0.01853 seconds