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

Home » Public Forums » archive » Re: how to do a loop in idl using multi-commmand?
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: how to do a loop in idl using multi-commmand? [message #43529 is a reply to message #43525] Fri, 15 April 2005 12:55 Go to previous messageGo to previous message
Paul Selby is currently offline  Paul Selby
Messages: 5
Registered: August 2003
Junior Member
Benjamin Hornberger wrote:
>
> If you want a FOR loop on the command line or in a batch file, you'll
> have to write it in one line, combining statements by "&":
>
> FOR I=0, 10000 DO BEGIN & x=2*nH2[i] & y=x*nH2[i] & ratio[i]=x/y & ENDFOR
>
> Note that the news client might have introduced a line break. This must
> be all in one line! I guess you realize it's better (more elegant, more
> understandable) to put it into a main-level or named program.
>
> Good luck,
> Benjamin

Actually you can put the statements on separate lines by using the line
continuation character "$" but it looks a bit messy

FOR I=0, 10000 DO BEGIN & $
x=2*nH2[i] & $
y=x*nH2[i] & $
ratio[i]=x/y & $
ENDFOR

Paul
[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: Nice ways to compile
Next Topic: .compile vs .run

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

Current Time: Sat Nov 29 00:19:59 PST 2025

Total time taken to generate the page: 0.72188 seconds