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

Home » Public Forums » archive » Re: Constructing integer variables from two bytes?
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: Constructing integer variables from two bytes? [message #78595] Wed, 07 December 2011 08:32 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
Yes - this is useful - I wish I'd known about it a long time ago!

IDL> a=[1b,2b,2b,3b,4b,5b]
IDL> b2=fix(a, 0, 3, type=2)
IDL> print,b2
513 770 1284

Seems to me, though, that offset should be 0 (unless you want to skip bytes), and you have to figure out the final number of integers yourself. However, it would have made more sense if it worked the way David said... specifying to grab 2 bytes at a time.

While on the topic, is there a similarly direct way to convert bytes into an arbitrary structure? To convert the above array into two of these {b:0b,i:0} for example?

cheers,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Coyote Graphics PDF Files
Next Topic: IDLDOC question

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

Current Time: Wed Oct 08 19:14:54 PDT 2025

Total time taken to generate the page: 0.00380 seconds