comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: type conversion

Re: type conversion
type: item
description: rensheu@yahoo.com writes: > I have a question about type conversion in IDL. > > I get a float value return by IDLffDICOM object, but it is stored in > byta[4]. Is there any way like in C as follows, > > char byta[4]={103, 38, 18, 68}; > float tmpv; > > pf = (float *)(&bytarr); > tmpv = (float)(*pf); > > convert the varible from a 4 elements byte array to a float point > variable in IDL? Try this: byta = [103B, 38B, 18B, 68B] var = Float(byta, 0) You need the offset (the second positional parameter), as I just learned again this morning to my chagrin. :-( Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/
creator: David Fanning
date: 2005-05-06T19:12:07-00:00

Re: type conversion
type: item
description: Hi David, Thank you so much!! R.D.
creator: rensheu
date: 2005-05-06T19:39:21-00:00