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

Home » Public Forums » archive » Re: Byte shift 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: Byte shift in IDL [message #2355] Wed, 29 June 1994 08:18
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
In article <2urg4sINN9rv@maz4.sma.ch>, oet@sma.ch (Thomas Oettli) writes:
|> I should translate the following C Code fragment to IDL:

|> unsigned long var;

There are no unsigned longs in IDL/WAVE, but no matter.

|> fread(&var, 1, 1, in_fp);

b = 0B ; declare one byte
readu, lun, b ; read one byte

|> var >>= 24; /* shift var to lowest byte */
(assuming sizeof(long) == 4)

var = long( b ) ; convert to long

I think this should do what you're after, that is read one byte from a
file and put it into the lower bits of a long.

If you want to do bit shifting, use the ISHIFT function.

;Dave
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: call_external under Solaris
Next Topic: license manager crash

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

Current Time: Wed Oct 08 19:22:12 PDT 2025

Total time taken to generate the page: 0.00636 seconds