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 #66459 is a reply to message #66274] Fri, 08 May 2009 05:10 Go to previous messageGo to previous message
tkg is currently offline  tkg
Messages: 2
Registered: May 2009
Junior Member
On May 7, 9:02 pm, "R.G. Stockwell" <noemai...@please.com> wrote:
> <t...@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

I saw that possibility and changed the code, but count
doesn't have a 'zero' case in the test data I've used so far.
Something else is causing the "variable is undefined" message.
If this were a C program, I'd suspect a buffer overrun, but,
being relatively new to IDL programming, I don't know how to
avoid that in IDL.

Thanks,
Tom
[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:34:11 PDT 2025

Total time taken to generate the page: 0.01063 seconds