[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Questions

Geoff Herbynchuk <gherbyn@irus.rri.on.ca> writes:

> Hi,
> Was just wondering if IDL can have pointers to structures.  I'm trying to
> access a variable in the structure with:
> 	if (*info).active_cursor EQ 1) then .....
> And I keep getting an error which says "Expression must be a structure in
> this context: <PtrHeapVar57>."
> Does anyone know what I'm doing wrong?

Umm, are you sure that INFO points to a structure?  I tried it and it
worked fine.  (see below).  Why not put a "HELP, *INFO, /STRUCT" right
before this statement and see what pops up?

IDL> struct = {active_cursor: 1}
IDL> info = ptr_new(struct)
IDL> help, (*info).active_cursor
<Expression>    INT       =        1
IDL> help, info
INFO            POINTER   = <PtrHeapVar1>


Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response