[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple question

"richard hilton" <rdh5@dmu.ac.uk> writes:

> This probably sounds like a stupid question but does anybody know of an IDL
> equivilent to the CONTINUE command in C/C++ ? Your help would be much
> appreciated.

I've wished for an equivalent to continue and break, but have never
found it.  You will have to do use GOTO explicitly.

for i = 0, n-1 do begin
  if val(i) EQ 0 then goto, NEXT_VAL ;; equivalent to continue
  compute_val, val(i)
  if val(i) LT 0 then goto, DONE_VAL ;; equivalent to break


Craig B. Markwardt, Ph.D.         EMAIL:    craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response