IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 27, 2006, 10:43:47 AM (20 years ago)
Author:
eugene
Message:

added last, next, return, fixed continue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/run_for.c

    r10647 r10846  
    7979
    8080  status = TRUE;
    81   interrupt = loop_break = FALSE;
     81  interrupt = FALSE;
    8282  for (value = start; (sign*value < sign*end) && !interrupt; value += delta) {
    83     loop_continue = loop_break = FALSE;
    8483    if ((int)value == value)
    8584      set_int_variable (argv[1], (int) value);
     
    8887    status = exec_loop (&loop);
    8988    value = get_double_variable (argv[1]);
     89    if (loop_next) continue;
     90    if (loop_last) break;
    9091    if (loop_break) break;
    91     if (loop_continue) continue;
    9292  }
    93   loop_continue = loop_break = FALSE;
     93  loop_last = loop_next = FALSE;
     94  /* 'last' and 'next' should only affect one loop */
    9495  if (auto_break && !status) loop_break = TRUE;
    9596
     
    99100  }
    100101  free (loop.line);
     102
    101103  if (loop_break) return (FALSE);
    102104  return (TRUE);
     
    109111*/
    110112     
     113/* while processing the loop, the loop status variables may be set
     114   by the loop commands, or the loop may quite on a failed command,
     115   setting the exec_loop return status to false. the loop status variables
     116   are:
     117   loop_next : stop this loop, but try another loop
     118   loop_last : stop loop processing, but return true so external loop may continue
     119   loop_break : stop loop processing, and return false so external loop will break
     120   interrupt : external interrupt signal
     121*/
     122
Note: See TracChangeset for help on using the changeset viewer.