/*
**  $VER: Intervall 4.011 (29 Nov 1998)  **
**
**        © 1998 Gerald Froehlich
**
**  PROGRAMNAME:
**      Intervall   *** noch nicht benutzt!!!!***
**
**  FUNCTION:
**      (De)aktivierung von Terminfeldern
**
**  $HISTORY:
**
**  29 Nov 1998 : 004.011 :  unverändert
**   30 Sep 1998 : 0.01 : initial release
*/

OPTIONS RESULTS
SIGNAL on error
SIGNAL ON break_c
SIGNAL ON break_d
SIGNAL ON break_e
SIGNAL ON break_f
SIGNAL ON failure
SIGNAL ON halt
SIGNAL ON ioerr
SIGNAL ON syntax

n = 0 /* nächstes Jahr - Flag */
F_neu = "6.282"

Sndpfad    = "HB:Senden/"     /* ÜW-Dateien-Pfad */
Ppfad  = "HB:Ablage/"     /* Pfad für Ablage */

IF GetClip("F_Version") ~< F_neu THEN DO

  IF ~abbrev(ADDRESS(), "FIASCO.") THEN DO
    /* Get list of all available ports */

    ports = show("Ports")

    /* Search for a port of Fiasco */

    do i = 1 to words(ports)

        portname = word(ports, i)

        if abbrev(portname, "FIASCO.") then
        do
            if datatype(substr(portname, 8), "Numeric") then
            do
                /* A port of Fiasco has been found.
                 * Now query Fiasco to return the port
                 * name of the active database.
                 */

                Address Value portname

                GetAttr Project Name Active ARexx

                /* This command may fail when
                 * no projects are active. This is
                 * for example the case, when all
                 * projects are hidden.
                 */

                if rc == 0 then
                do
                    Address Value Result
                end
                else
                do
                    RequestChoice '"No active project" "Cancel" Title "' || scriptname || '"'

                    call bail_out
                end

                break
            end
        end
    end
  END

  fiasco_port = ADDRESS()

  GetAttr Application SCREEN VAR screen

END
ELSE     screen = GetClip('screenName')

IF (~show('l','rexxreqtools.library')) THEN
    CALL AddLib('rexxreqtools.library',0,-30,0)

IF (~show('l','rexxtricks.library')) THEN
    CALL AddLib('rexxtricks.library',0,-30,0)

lockGui

TRACE i
ActivateField "Termin"

'setattr field Name "Termin" Attribute ReadOnly 1'
SAY rc

unlockgui
TRACE off
EXIT

/*###################################
*** Debugging-Fehlerroutinen *******
###################################*/
syntax:
text =  'Syntax-Fehler' rc 'in Zeile' sigl '0A'x ErrorText(rc),
    '0A'x || SourceLine(sigl)
   CALL rtezrequest(text,"Alles klar!", "Fehlermeldung Termin",'rt_pubscrname='screen)
  EXIT 10

failure:
ioerr:
ERROR:
text =  'Fehler' rc 'in Zeile' sigl '0A'x ErrorText(rc),
    '0A'x || SourceLine(sigl)
   CALL rtezrequest(text,"Alles klar!", "Fehlermeldung Termin",'rt_pubscrname='screen)
  EXIT 10
halT:
break_c:
break_d:
break_e:
break_f:
text =  'User-Abbruch durch Halt!' || '0A'x || 'Wirklich abbrechen ?'
 ab = rtezrequest(text,"_Mach Schluss|_Neeiiin", "Termin",'rt_pubscrname='screen)
 IF ab = 1 THEN DO
   EXIT
 END
 ELSE RETURN

