/* AREXX-Prg. "ToggleKeyMode"

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

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
km = rco_fmgetkeymode()
if km > 6 then km = 0
km = km + 1

address "FrameMachine"

call displaymode(3,km)
call unlockfm()
call phoneit
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

phoneit:
p = " "
if km = 1 then p = "AY4NTS"
if km = 2 then p = "TSVAY4"
if km = 3 then p = "DRAY4"
if km = 4 then p = "FIHIH8R"
if km = 5 then p = "FUHIX4NF"
if km = 6 then p = "ZEH8KS"
if km = 7 then p = "ZIHIH7BEH3N"
phone = "KEYIH6IXMOW6DQX  " || p
call rco_phone(phone)
return

/*Ende des Skripts*/




