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

Home » Public Forums » archive » Re: changing a datatype in a structure
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: changing a datatype in a structure [message #48653 is a reply to message #48648] Wed, 10 May 2006 22:02 Go to previous messageGo to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
mark.macauda@gmail.com wrote:

> Ok, here is my current very frustrating problem. I have ALOT of IDL
> work done the general idea is that I read in binary files that are
> stored in very specific format...blah blah, the details aren't
> important, the important part is that rewriting all of that becuase of
> the current problem is not a desirable solution. Here's the problem.
> All the info is read in in structures and the data types are dictated
> by the binary files. One is an array of long 32-bit integers. I have
> discovered that I need to do some calculations on this array, that
> require the data type to be something other than interger. Normally I
> would just use the float command and be on my merry way...but for all
> the other programs to work I need the float arrays to be back in the
> handy dandy structures...is there anyway I can easily change that
> datatype?

You should have a look at this both functions

http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/struct2ptr_struct_dbase.pro.html
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_source/idl _html/dbase/ptr_struct2struct_dbase.pro.html

struct={A:1,b:FINDGEN(10)}
HELP,struct,/str
** Structure <1052378>, 2 tags, length=44, refs=1:
A INT 1
B FLOAT Array[10]
result=struct2ptr_struct(struct)
HELP,result,/str
** Structure <10551e8>, 2 tags, length=8, refs=1:
A POINTER
B POINTER
*result.a=1.234
result=ptr_struct2struct(result,/free)
HELP,result,/str
** Structure <1056e28>, 2 tags, length=44, refs=1:
A FLOAT 1.234
B FLOAT Array[10]

cheers
Reimar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 6.3 reactions?
Next Topic: VIRUS: [avast! - INFECTED] HOT TEEN WEB CAM SHOTS FROM MSN MESSENGER

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

Current Time: Wed Oct 08 17:55:55 PDT 2025

Total time taken to generate the page: 0.00446 seconds