          SUBROUTINE (FKEY)
** Version# 11.0002[3] - 04/27/2014 - 10:33pm - TSMITH - eclipse
*** V11.0002 Change - Custom Coding . - 04/27/2014 - TSMITH - eclipse
*** V11.0001 Change - Custom Coding . - 04/27/2014 - TSMITH - eclipse

*** Subroutine: FKEYS.ALT
*-------------------------------------------------------------------------*
*** This program is used to direct various actions when Alt-Fx F-Key
*** is pressed in Eclipse.  The x in Alt-Fx represents Alt Function
*** keys F1 - F12.
*** F1-F10 are used to call UD screens for user defined functions.
*** UD screens are all run by FORM.RUN.  It can also just have a program
*** that should be called.
*** Alt-F12 calls the alt Fkeys maint program
*** Alt-F11 calls the display alt Fkeys program which displays the
***         description of each UD screen defined by ALT-F12.
*-------------------------------------------------------------------------*
*** FKEY [IN] - The function key pressed in conjunctions with the Alt key.
*-------------------------------------------------------------------------*
          IF USER.ID = '' THEN RETURN

          SCRN.ID = LAST.SCR.<WINDOW.LEVEL>

          BEGIN CASE
          CASE FKEY = 12
             FKEYS.ALT.MAINT SCRN.ID
          CASE FKEY = 11
             FKEYS.ALT.DISP  SCRN.ID
          CASE OTHERWISE
             * read the UD screen
             READ SCRNS FROM WORKFILE,'SCRN~':SCRN.ID ELSE SCRNS = ''

             FORM.ID = SCRNS<1,FKEY>
             PRI.NO  = SCRNS<2,FKEY>
             BEGIN CASE
             CASE PRI.NO = 1;         PRI.ID = OID.DATA$<1>;  * OID
             CASE PRI.NO = 2;
                READV WRK FROM LEDFILE,OID.DATA$<1>,1 ELSE WRK = ''
                GEN = OID.DATA$<2>; IF GEN < 1 THEN GEN = 1
                PRI.ID = WRK<1,GEN>
             CASE PRI.NO = 3;
                READV WRK FROM LEDFILE,OID.DATA$<1>,5 ELSE WRK = ''
                GEN = OID.DATA$<2>; IF GEN < 1 THEN GEN = 1
                PRI.ID = WRK<1,GEN>
             CASE PRI.NO = 4;
                LD.READV PRI.ID, OID.DATA$<1>, OID.DATA$<3>, 1
             CASE PRI.NO = 5;         PRI.ID = OID.DATA$<4>;  * CN
             CASE PRI.NO = 6;         PRI.ID = OID.DATA$<5>;  * PN
             CASE PRI.NO = 8;         PRI.ID = ''
             CASE PRI.NO = 9;
                PRI.ID = OID.DATA$<1>:"~":OID.DATA$<3>
             CASE PRI.NO = 10;
             NAME = TRANS('ENTITY',OID.DATA$<4>,1,'X')
             CONVERT " " TO "_" IN NAME
             CONVERT " " TO "_" IN NAME
             PTIME = OCONV(TIME(),'MT')
             PRI.ID = USER.ID:"~":OID.DATA$<4>:"~":NAME:"-":FIELD(OCONV(DATE(),'D4-'),'-',3):'-':FIELD(OCONV(DATE(),'D2-'),'-',1):'-':FIELD(OCONV(DATE(),'D2-'),'-',2):"-":PTIME ; *Pipeline

             CASE PRI.NO = 0;         PRI.ID = ''
             CASE OTHERWISE;          PRI.ID = ACT.ID$
             END CASE

             IF FORM.ID#'' THEN
                IF FORM.ID[1,2] = 'P:' THEN
                   SUBR = FORM.ID[3,25]
                   CALL @SUBR(PRI.ID)
                END ELSE
                   FORM.RUN FORM.ID,PRI.ID
                END
             END
          END CASE

FINISH:   RETURN
*-------------------------------------------------------------------------*
!TSMITH~04/27/14~22:33
