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

Home » Public Forums » archive » Re: integer?
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: integer? [message #31628 is a reply to message #31622] Tue, 30 July 2002 08:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
tom (tom2959@21cn.com) writes:

> This is a segment of HEX: 00 00 00 64
>
> there are two 2byte-integers in it.
> But when I set
> a=0
> readu,lun,a ; I hope a=hex(00 00)
> print,a
> the result is 100. That's a=hex(00 00 00 64)
> that's the same as "a=0l readu,lun,a"
>
> how to read 2byte integer then?

Like this:

IDL> a = '00000064'x
IDL> HELP, a
A INT = 100
IDL> Print, 'High order byte: ', Byte(a, 1)
High order byte: 0
IDL> Print, 'Low order byte: ', Byte(a, 0)
Low order byte: 100

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Molecular models and contour maps
Next Topic: Re: Image scrolling, displaying axes from outside the visible window

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

Current Time: Sun Oct 12 16:32:30 PDT 2025

Total time taken to generate the page: 0.00216 seconds