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

Home » Public Forums » archive » Re: Defining IDL structures given variable type, width and precision
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: Defining IDL structures given variable type, width and precision [message #54061] Thu, 17 May 2007 07:07
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 16, 10:24 pm, David Fanning <n...@dfanning.com> wrote:
> Jonathan Greenberg writes:
>> Is there a trick to defining an IDL structure with the appropriate
>> variable types given that type, width and precision of each variable?
>> I am extracting data from a .dbf file, then using the envi_write_dbf
>> command to basically copy the dbf file, but I'm running into problems
>> with a string field in the original DBF that appears to be longer than
>> simply assigning that field during the create_struct portion to be '',
>> e.g.
>
>> structure=create_struct(structurename:'') <- how would I assign that
>> if I know the type is "7" (string), width=43, precision=0
>
> Strings in IDL can be any "width", so this must be a .dbf file
> requirement. It is probably better to save the string as
> a byte array, in this case, and convert to and from a string as
> needed.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

or maybe structure =
create_struct(stucturename:string(bytarr(43)+byte(32))) ? (for
example, If you want just spaces)
Re: Defining IDL structures given variable type, width and precision [message #54073 is a reply to message #54061] Wed, 16 May 2007 20:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jonathan Greenberg writes:

> Is there a trick to defining an IDL structure with the appropriate
> variable types given that type, width and precision of each variable?
> I am extracting data from a .dbf file, then using the envi_write_dbf
> command to basically copy the dbf file, but I'm running into problems
> with a string field in the original DBF that appears to be longer than
> simply assigning that field during the create_struct portion to be '',
> e.g.
>
> structure=create_struct(structurename:'') <- how would I assign that
> if I know the type is "7" (string), width=43, precision=0

Strings in IDL can be any "width", so this must be a .dbf file
requirement. It is probably better to save the string as
a byte array, in this case, and convert to and from a string as
needed.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: exposing variables to higher program levels
Next Topic: why I can't use the max memory available?

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

Current Time: Wed Oct 08 19:21:31 PDT 2025

Total time taken to generate the page: 0.00676 seconds