DISPLAY(Off!)
CANCEL(OFF!)
MenuList(choice;{"~Save all and continue";"~Close all after
saving"};)
Switch(Choice)
     CASEOF 1:
          Closeall="No"
     CASEOF 2:
          Closeall="Yes"
          GO(DoIt)
ENDSWITCH
ASSIGN(StartDoc; ?DocNumber)
LABEL(DoIt)
FORNEXT(Docnum; 1; 9; 1)
     SwitchDoc(Docnum)
     IF (?DocBlank)
          Close
     ELSE
       IF (?DocModified)
            Save
       ENDIF
       IF (Closeall="Yes")
            Close
       ENDIF
     ENDIF
ENDFOR
IF (Closeall="No")
     SwitchDoc(StartDoc)
ENDIF
