/* AREXX-Prg. "InitFM": Initialisierung mit Standardwerten

   $VER: 1.4 (18.2.96) 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()

address "FrameMachine"

call displaymode(3,7)  /*nur WB sichtbar*/
fm_choose titel "ARexx-Skript InitFM" text "Initialisierung wirklich ausführen?"
antwort = result
if antwort = reqcancel then
do                      /*Abbruch*/
  call displaymode(dmode,keymode)
  call unlockfm()
  exit
end
/*Ausführung*/
call rco_fmsetsavedprefs()       /*letzte Einstellungen holen*/
call rco_lace(ON)                /*Interlace einschalten*/
call rco_fmsetinput(YC)
call rco_beep(1500,5)
call displaymode(3,2)
call displaysize(0)
call digistate(1)
call unlockfm()
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*/




