/* AREXX-Prg. "QuitFM": Keymode 7 einschalten und FrameMachine beenden

   $VER: 1.2 (7.10.95) © Uwe Schröder
 */

reqok = 55       /*Rückgabewerte von fm_choose*/
reqcancel = 56

if ~show('L',"rexxcontrol.library") then do
 if ~addlib("rexxcontrol.library",0,-30,1) then exit 20
end

if ~show('L',"framemachine.library") then do
  fmlib = addlib("framemachine.library", 0, -30, 2)
  if ~fmlib then signal murks
end

if ~show('P',"FrameMachine") then signal murks

call lockfm() /*Zugriff sichern*/

options results

dmode = rco_fmgetdisplaymode() /*Modi holen*/
if dmode = "FMTrouble"
then do
  call unlockfm()
  signal murks
end
keymode = rco_fmgetkeymode()
size = rco_fmgetdisplaysize()

address "FrameMachine"

call displaymode(3,7)  /*nur WB sichtbar*/
fm_choose titel "ARexx-Programm QuitFM" text "Programm wirklich beenden ? "
antwort = result
if antwort = reqcancel then
do
  call displaymode(dmode,keymode)
  call displaysize(size)
  call unlockfm()
  exit
end

call displaymode(3,7)
call displaysize(0)
call unlockfm()
call rco_lace(OFF)      /*Interlace aus*/
call rco_beep(1500,5)
call rco_wait(40)
options no results
fm_quit

exit 0            /*alles klar, Schluß*/

murks:
call sos          /* bei Fehler SOS morsen*/
exit 20

sos:
call beep(7)
call beep(15)
call beep(7)
return

beep:
arg len
do i = 1 to 3
  call rco_beep(750,len)
  call rco_wait(6)
end
call rco_wait(6)
return

/*Ende des Skripts*/




