# Function: stopwaitbar

## CALL:

stop = stopwaitbar(HWIN)

## DESCRIPTION:

Return false if waitbar has been removed or stopped

## INPUT:

          HWIN:  <handle> of the figure with the waitbar(s)
                 HWIN==-1: ignore mode

      OUTPUT
          stop: TRUE  ==> stop
                FALSE ==> continue

## EXAMPLE:

        for k=1:10
            hwait=multiwaitbar('loop1',10*k,sprintf('k=%d',k));
            for r=1:5:100
                if stopwaitbar(hwait),return;end
                multiwaitbar('loop2',r,sprintf('r=%d',r));
                pause(0.01)
            end
        end
        multiwaitbar('loop1',-1);
        multiwaitbar('loop2',-1);

      See also
          multiwaitbar
          closewaitbar