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

Home » Public Forums » archive » Creating arrays of structures with Callable C
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Creating arrays of structures with Callable C [message #43500] Mon, 18 April 2005 10:29 Go to previous message
jicicuendez is currently offline  jicicuendez
Messages: 12
Registered: November 2001
Junior Member
Hi everybody,

I am trying to use callable C/C++ code to generate a plot with IDL
from another application and there are a couple of things that I am
stuck with. Any help will be most appreciated.

First, in the IDL documentation, there is an example of how to create
and structure (page 176). This is done through a two-step procedure of
creating an IDL_STRUCT_TAG_DEF and then creating an structure with the
data itself such as

typedef struct time_series
{
double x[100];
double y[100];
char RGB[3];
int long nElements;
IDL_STRING source[1];

}
TIME_SERIES;

The problem is that in principle the number of elements is not known
until is provided so I would like to substitute this by:

typedef struct time_series
{
double *x;
double *y;
char RGB[3];
int long nElements;
IDL_STRING source[1];

}
TIME_SERIES;

and where memory has been allocated with new. Apparently the structure
can be created in the idl session with the IDL_MakeStruct function but
when I try to use such structure with and idl command it gives a
memory exception. Does anybody know how to avoid this problem?

Cheers,
Juan
[Message index]
 
Read Message
Read Message
Previous Topic: IDL - ENVI batch mode question
Next Topic: Re: what is Floating illegal operand question?

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

Current Time: Wed Oct 08 15:33:44 PDT 2025

Total time taken to generate the page: 0.00482 seconds