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

Home » Public Forums » archive » Re: while loop crashes
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: while loop crashes [message #71151 is a reply to message #71150] Tue, 01 June 2010 03:18 Go to previous messageGo to previous message
Spon is currently offline  Spon
Messages: 178
Registered: September 2007
Senior Member
On Jun 1, 8:51 am, hovru <h.rube...@gmail.com> wrote:
> Wouldn't you not need the "Pro" and "End" if it's not a program, just
> a script (such as when you use "Journal")?
> Also, leaving out the "return" should be fine, since there is only one
> level, right?
>
> Thanks.

Looks like you can't have loops or statements in batch files; every
statement has to be complete, just like if you were using the command
line.

So, this works fine, but your program does not:
---
print, 'start while loop'
j=2
while (j NE 10) do j=j+1

print, 'done', j
---

Have a look at the helpfile for 'Executing Batch Jobs in IDL', I
guess.
I've always wondered why people even use batch mode, when procedures
and functions are almost as easy to write. What is the advantage of
batch mode?

No, you don't need the 'return', but what harm is it doing? Plus, if
you decide to modify the code to pass variables or keywords to it
later, you might wonder why they never come back. :-)

Chris
[Message index]
 
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: How to set the multiple xaxis labels
Next Topic: A Contour Tracking Problem

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

Current Time: Sat Oct 11 03:23:56 PDT 2025

Total time taken to generate the page: 1.35989 seconds