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

Home » Public Forums » archive » pointer problems
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: pointer problems [message #66467 is a reply to message #66274] Thu, 07 May 2009 20:02 Go to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
<tkg@lanl.gov> wrote in message
news:e7dfb99c-91cd-483f-93ba-9e13c31f659a@y33g2000prg.google groups.com...
>
>
> I'm trying to store an array of pixel xy indicies for later output to
> a text file. The number of xy pairs is different for each array
> element. I'm trying to use pointers to do this with the following
> code snippet:
>
> xy = ptrarr(npixels, /ALLOC)
>
> for ipixel = 0, npixels - 1 do begin
>
> ; much snipped code
>
> indi = where(superMask ne 0, count)
>
> if (count gt 0) then *xy[ipixel] = array_indices(superMask,
> indi)
>
> ; more snipped code
>
> endfor

You need an else branch to assign the values of
*xy in the case where count is = 0.

Or else, accessing xy in the future can result in
"variable is undefined" error messages.


cheers,
bob
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: P value for the regression analysis?
Next Topic: Re: best image plotting routine

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

Current Time: Wed Oct 08 17:05:46 PDT 2025

Total time taken to generate the page: 0.01277 seconds