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

Home » Public Forums » archive » Including files
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: Including files [message #15617 is a reply to message #15524] Thu, 27 May 1999 00:00 Go to previous message
eddie haskell is currently offline  eddie haskell
Messages: 29
Registered: September 1998
Junior Member
Liam Gumley wrote:

> block termination statements (ENDFOR, ENDIF, ENDREP, ENDWHILE)
> are only allowed in procedures or functions.

I have no problems with using ENDs in most places. It is a matter of
properly placed '&'s and '$'s. I saved the following code, which does
nothing worthwhile, as TEST (without the .pro) and was able to use it in
$MAIN$, procedures, functions, other loops, and at the command prompt as
@TEST
and it also works just by copying the block to the command prompt.
This works on my Unix box, IDL5.1, but I would be surprised if this was
version or platform dependent. Granted, this makes the code look a tad
ugly, but I have had occasions where it was handy to "batchify" a couple
hundred lines of code like this.

;;;;;; TEST ;;;;;;;;;;;;;;;;;;;;
i=0
FOR j=0,2 do begin $
i=i+1 & $
IF (j ge 1) then begin $
i=i+1 & $
REPEAT begin $
i=i+1 & $
WHILE (i lt 20) do begin $
i=i+2 & $
CASE j of & $
0 : i=i+1 & $
else : i=i-1 & $
ENDCASE & $
ENDWHILE & $
ENDREP until (i gt 25) & $
ENDIF & $
ENDFOR
print,i
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Cheers,
eddie

----- ---- --- --- ---- --- -- --- --- -- -- - - - -
|\ A G Edward Haskell
|\ Center for Coastal Physical Oceanography
|\ Old Dominion University, Norfolk VA 23529
|\ Voice 757.683.4816 Fax 757.683.5550
|\ e-mail haskell*ccpo.odu.edu
----- ---- --- ---- --- --- --- --- -- -- -- - - - -
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Roundoff error in SMOOTH
Next Topic: IDL 5.2 GUI Builder Tutorial ?

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

Current Time: Sat Oct 11 00:29:33 PDT 2025

Total time taken to generate the page: 1.04016 seconds