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

Home » Public Forums » archive » Moving to objects loses array functionality?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Moving to objects loses array functionality? [message #63306] Mon, 03 November 2008 14:43
Anonymous
Originally posted by: Demitri

Hi,

I'm trying to implement some of my data as proper IDL objects, but I'm
either missing some syntax or else am losing some array functionality
in the process.

Let's say I have the following structures:

void = {BOOK, $
author : '', $
pChapters : PTR_NEW()}

void = {CHAPTER, $
title : '', $
pageCount : 0}

pChapters is a pointer to contain a variable number of chapters in the
BOOK structure. If I create an array of BOOKs, I can do this:

IDL> print, books.author

...and get a list of all of the authors. I can also use utilities like
WHERE of course.

What I'm wondering is if I can extract a list of, say, all of the
chapter names as a list (perhaps my example doesn't seem useful, but
ignore that!). I was hoping something like this would work:

IDL> print, (*books.pChapters).title

...especially since "books.pChapters" does return an array of pointers.

Is there something I can do here without resorting to FOR loops within
methods in the BOOK object?

Cheers!

Demitri
[Message index]
 
Read Message
Previous Topic: Starting an old IDL version
Next Topic: Threads in IDL 7.0

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

Current Time: Fri Oct 10 08:34:15 PDT 2025

Total time taken to generate the page: 0.48782 seconds