%N ctrlwait %F $MIR/src/subs/ctrl.for
%D Wait for a button to be pressed.
%P jm
%: user-interaction, control-panel
%B
        subroutine CtrlWait(name,changes,val1,val2)

        implicit none
        character name*(*)
        integer changes,val1,val2

  Waits for any panel item to be modified.  If one or several items
  have previously changed, this routine returns immediately and passes
  back the first item that it happens to find that has changed.

  NOTE:  This routine will block until something has been modified.

  Output:
    name       The name of the item that changed.
    changes    The number of times the item has been changed.
    val1,val2  Two values associated with the item.
