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

Home » Public Forums » archive » Re: Defining Integer Field 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: Defining Integer Field in a Structure [message #27735 is a reply to message #27732] Thu, 01 November 2001 13:24 Go to previous messageGo to previous message
John-David T. Smith is currently offline  John-David T. Smith
Messages: 384
Registered: January 2000
Senior Member
Brian Bell wrote:
>
> Is there a way to define a field within a structure whose type is
> integer? In my case, I want the field to be any integer from 0 to 4.
> I know you can assign an actual integer to the field, but I don't want
> to do this because I want the field value to change within certain
> procedures and to return that value to the procedures calling it. I
> would appreciate any help you might be able to offer.
>

This is illegal:

IDL> a={0:"this", 1:"is",2:"a",3:"funny",4:"test"}

so the short answer is no. However, if you just want 4 numbered
"slots", try an array:

IDL> a={vals:['this','is','a','funny','test']}
IDL> print,a.vals[1]
is

if you'd like the types of each slot to be different, try at a pointer
array. If you'd like the number of "slots" to be variable, try a
pointer to a pointer array.

JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: FSFC/IDL5.5 installation
Next Topic: RSI, Mac and Tru64

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

Current Time: Sun Oct 12 10:43:58 PDT 2025

Total time taken to generate the page: 3.27564 seconds