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

Home » Public Forums » archive » Re: Need Help Resolving ENDIF Errors
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: Need Help Resolving ENDIF Errors [message #65533 is a reply to message #65532] Tue, 10 March 2009 14:56 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
einszweilieb@gmail.com wrote:
> I'm trying to run a procedure in IDL. The procedure has a series of
> IF LOOPS, each of minimal complexity - they are fairly simple.
>
> For example:
>
> XX=readfits('/home/kphil/img/img213.fits')
> YY=readfits('/home/kphil/img/img213.fits', EXTEN_NO=1)
> ZZ =YY
>
> G = where(ZZ ne 0)
> invarmap= ZZ * 0.0
> invarmap[G] = (1./(ZZ[G])^2)
>
> if ((where(XX ne XX))(0) ne -1) then begin
> ZZ[where(XX ne XX)] = 0
> XX[where(XX ne XX)] = 0
> endif
>
>
> The problem is that everything runs just great, until the ENDIF is
> reached. I CONSTANTLY get ENDIF errors.

Weird. On *every* endif?

> Why is this happening? I feel that my code is solid, but all I get
> are ENDIF errors.

Such basic syntax error reports are an indication code is definitely not "solid". Now,
don't take that the wrong way: most of my code qualifies in the jello category so I'm
quite familiar with the phenomenon. :o)

Apart from the strangeness of "where(XX ne XX)", what happens if you replace

if ((where(XX ne XX))(0) ne -1) then begin

with

if ((where(XX ne XX))[0] ne -1) then begin

?

cheers,

paulv

> The .pro I'm running has about 7 IF LOOPS, and the ONLY errors I get
> are on the lines where ENDIF is.
>
> Any idea what the problem is? Help!
>
> Thanks in advance.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: using irregularly spaced coordinates with ray-casting in iVolume
Next Topic: OpenADDE and IDL

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

Current Time: Thu Oct 09 16:04:29 PDT 2025

Total time taken to generate the page: 0.16053 seconds