¿ Quieres imprimir esta página ? Volver a la página principal de Recursos iSeries AS400 ¿ Necesitas ayuda ? En pruebas
System i5 iSeries AS400 Recursos. Compartiendo generamos conocimiento
Novedades en Recursos iSeries AS400
Noticias tecnológicas
Documentos
Ejemplo de menú desplegables en RPG

Este ejemplo enviado por Rainer nos permite desarrollar menús desplegables (pulldown) para nuestras aplicaciones RPG

Descripción del menú

     

    *================================================================
    * Display file... CUSTDSPF                                      =
    * Description.... Pull-down menu example                        =
    *================================================================
   A                                      MNUBARSW(CA10) MNUCNL(CA12)
    *----------------------------------------------------------------
    * Sample record format specifying a menu bar                    -
    *----------------------------------------------------------------
   A          R DSP01
   A                                      MNUBARDSP(MENUBAR         +
   A                                                &MNUSLT         +
   A                                                &OPTSLT)
   A                                  4 27'Example using pulldown Menus'
   A                                  7  2'Customer ID:'
   A            CUSTID        10   B  7 15DSPATR(PC)
   A            MNUSLT         2Y 0H
   A            OPTSLT         2S 0H
    *----------------------------------------------------------------
    * Menu bar record format                                        -
    *----------------------------------------------------------------
   A          R MENUBAR                   MNUBAR
   A            MNUSLT         2Y 0B  1  2
   A                                      MNUBARCHC(1 MNUFILE       +
   A                                                  '>File')
   A                                      MNUBARCHC(2 MNUVIEW       +
   A                                                  '>View')
    *----------------------------------------------------------------
    * File menu choice format                                       -
    *----------------------------------------------------------------
   A          R MNUFILE                   PULLDOWN
   A            SLT1           2Y 0B  1  2SNGCHCFLD
   A                                      CHOICE(1 '>Save')
   A                                      CHOICE(2 '>Print')
   A                                      CHOICE(3 '>Exit')
    *----------------------------------------------------------------
    * View menu choice format                                       -
    *----------------------------------------------------------------
   A          R MNUVIEW                   PULLDOWN
   A            SLT1           2Y 0B  1  2SNGCHCFLD
   A                                      CHOICE(1 '>Current')
   A                                      CHOICE(2 '>History')

Programa RPG

     

      *================================================================
      * Program....... CUSTRPG                                        =
      * Description... Pull-down menu example                         =
      *================================================================
     FCUSTDSPFCF  E                    WORKSTN
      *================================================================
      * Process until Exit selected                                   =
      *================================================================
     C           EXIT      DOUEQ*ON
     C                     EXFMTDSP01
     C                     SELEC
      *----------------------------------------------------------------
      * Pull-down menu was selected                                   -
      *----------------------------------------------------------------
     C           MNUSLT    WHNE 0
     C                     EXSR MNU
      *----------------------------------------------------------------
      * Pull-down menu was not selected, process normally             -
      *----------------------------------------------------------------
     C                     OTHER
          .
          .
          .
     C                     ENDSL
     C                     ENDDO
      *----------------------------------------------------------------
      * Exit selected, stop program                                   -
      *----------------------------------------------------------------
     C                     MOVE *ON       *INLR
      *================================================================
      * Process menu selection                                        =
      *================================================================
     C           MNU       BEGSR
     C                     SELEC
     *----------------------------------------------------------------
      * File menu selected                                            -
      *----------------------------------------------------------------
     C           MNUSLT    WHEQ 1
     C                     EXSR MFILE
      *----------------------------------------------------------------
      * View menu selected                                            -
      *----------------------------------------------------------------
     C           MNUSLT    WHEQ 2
     C                     EXSR MVIEW
     C                     ENDSL
     C                     ENDSR
      *================================================================
      * Process File menu option selection                            =
      *================================================================
     C           MFILE     BEGSR
     C                     SELEC
      *----------------------------------------------------------------
      * Save selected                                                 -
      *----------------------------------------------------------------
     C           OPTSLT    WHEQ 1
     C                     CALL 'SAVERTN'
      *----------------------------------------------------------------
      * Print selected                                                -
      *----------------------------------------------------------------
     C           OPTSLT    WHEQ 2
     C                     CALL 'PRINTRTN'
      *----------------------------------------------------------------
      * Exit selected                                                 -
      *----------------------------------------------------------------
     C           OPTSLT    WHEQ 3
     C                     MOVE *ON       EXIT    1
     C                     ENDSL
     C                     ENDSR
      *================================================================
      * Process View menu option selection                            =
      *================================================================
     C           MVIEW     BEGSR
     C                     SELEC
      *----------------------------------------------------------------
      * Current selected, load current customer information           -
      *----------------------------------------------------------------
     C           OPTSLT    WHEQ 1
     C                     EXSR LDCUR
      *----------------------------------------------------------------
      * History selected, load historical customer information        -
      *----------------------------------------------------------------
     C           OPTSLT    WHEQ 2
     C                     EXSR LDHST
     C                     ENDSL
     C                     ENDSR

Puedes ver el fuente aquí (2Kb)
Autor: Rainer

Julio 2003

Comentarios de usuarios

Nombre:
Mail:
Comentario:
 

Subir a la parte superior de la web

 

 

NUESTRA COMUNIDAD EN
ÚNETE Y.... ¡¡ PARTICIPA !!
Dossiers técnicos iSeries y AS400
- Seguridad
- Alta disponibilidad.
Nuestros links favoritos
- Tendencias tecnologías de la información
Expertos en tecnologías de la información, nos dan su punto de vista sobre las tendencias actuales y futuras
- Los últimos anuncios sobre hardware-software para iSeries AS400 realizados por IBM
- Freeware y shareware para el iSeries AS400
- Utilidades para el iSeries AS400 realizadas por profesionales
- Documentos. Trucos e ideas para resolver tus problemas
- Los manuales y links más interesantes del iSeries AS400

  Links patrocinados
  •  
  •  

[ Soy nuevo |   Profesionales |   AS qué |   Empresas |    Foros |   Recomiéndanos |    Productos ]
 
Recursos iSeries AS400. Es una web de: PUBLICACIONES HELP400, S.L. CIF:B-60-202827 Gran Vía de les Corts Catalanes, núm. 715, Entresuelo – 3ª - Barcelona - Tel.+34.932.310.049