星期二, 10月 31, 2023

2000-03-27 如何撰寫類似 AS/400 的(Help key F1)畫面說明,並用於一般,應用系統中 ?


如何撰寫類似 AS/400 的(Help key F1)畫面說明,並用於一般,應用系統中 ?

1. PF : CUSTPF
      *==============================================================*
      * Sample Customer File (Partial)                               *
      *==============================================================*
      *
     A                                      UNIQUE
     A          R CUSTPR                    TEXT('Customer Record')
      *
     A            CUSTNO         7P 0       COLHDG('Customer' 'Number')
     A                                      TEXT('Customer number')
     A            CNAME         30A         COLHDG('Customer name')
     A                                      TEXT('Customer name')
     A            CSTRT         30A         COLHDG('Street address')
     A                                      TEXT('Street address')
     A            CCITY         20A         COLHDG('City')
     A                                      TEXT('City')
     A            CSTATE         2A         COLHDG('State')
     A                                      TEXT('State')
     A            CZIP           9A         COLHDG('Zip code')
     A                                      TEXT('Zip code')
     A            CCONT         30A         COLHDG('Customer contact')
     A                                      TEXT('Customer contact')
     A            CCTITL        30A         COLHDG('Contact title')
     A                                      TEXT('Contact title')
     A            CPHONE        10P 0       COLHDG('Contact' 'Phone' 'Number')
     A                                      TEXT('Contact phone number')
     A            NOTES1        40A         COLHDG('Notes 1')
     A                                      TEXT('Notes 1')
     A            NOTES2        40A         COLHDG('Notes 2')
     A                                      TEXT('Notes 2')
     A            CLORDT         6S 0       COLHDG('Last order date')
     A                                      TEXT('Last order date')
     A            CBALNC        11P 2       COLHDG('Current' 'Balance')
     A                                      TEXT('Current balance')
     A                                      EDTCDE(J)
     A            CCRFLG         1A         COLHDG('Good Credit Y/N?')
     A                                      TEXT('Credit Flag')
     A                                      VALUES('Y' 'N')
      *
     A          K CUSTNO


2. PNLGRP: CUSTPG

:PNLGRP.
.*The following is the global help panel (extended help)

:HELP name=GLOBALHLP.Customer File Maintenance - Help
:P.This panel is used to maintain customer records
:EHELP.

.* The remaining panels are context sensitive panels (contextual help).

:HELP name=NUMBER.Customer Number - Help
:xh3.Customer Number field (CUNUMB)
:P.Use this field to enter the customer number you would like to maintain.
:EHELP.
.*________________________________________________________
:HELP name=NAME.Customer Name - Help:xh3.Customer Name field (CUNAME)
:P.Use this field to enter the customer name.
:EHELP.
.*________________________________________________________
:HELP name=ADDRESS.Customer Address - Help
:xh3.Customer Address field (CUADRS):P.Use this field to enter the
 customer street address or Post Office box.
:EHELP.
.*________________________________________________________
:HELP name=CITY.Customer City - Help
:xh3.Customer City field (CUCITY)
:P.Use this field to enter the customer city.
:EHELP.
.*________________________________________________________
:HELP name=STATE.Customer State Code - Help
:xh3.Customer State Code field (CSTATE)
:P.Use this field to enter the customer  code.
:EHELP.
.*________________________________________________________
:HELP name=ZIP.Customer Zip Code - Help
:xh3.Customer Zip Code field (CUZIP)
:P.Use this field to enter the customer zip code.
:EHELP.
.*________________________________________________________
:EPNLGRP.

3. DSPF: UIMHELP
     A                                      DSPSIZ(24 80 *DS3)
     A                                      CA03(03)
     A                                      CA12(03)

     A                                      HELP
     A                                      ALTHELP(CA01)
     A                                      HLPTITLE('Customer File -
     A                                      Maintenance - Help')
     A                                      HLPPNLGRP(GLOBALHLP CUSTPG)

     A          R MAINFMT

     A          H                           HLPARA(*FLD CUNUMB)
     A                                      HLPPNLGRP(NUMBER CUSTPG)
     A          H                           HLPARA(*FLD CUNAME)
     A                                      HLPPNLGRP(NAME CUSTPG)
     A          H                           HLPARA(*FLD CUADRS)
     A                                      HLPPNLGRP(ADDRESS CUSTPG)
     A          H                           HLPARA(*FLD CUCITY)
     A                                      HLPPNLGRP(CITY CUSTPG)
     A          H                           HLPARA(*FLD CUSTE)
     A                                      HLPPNLGRP(STATE CUSTPG)
     A          H                           HLPARA(*FLD CUZIP)
     A                                      HLPPNLGRP(ZIP CUSTPG)

     A                                  2 28'Customer File Maintenance'
     A                                  4  2'Customer Number . .'
     A            CUNUMB         5   I  4 23
     A                                  6  2'Name . . . . . . .'
     A            CUNAME    R        B  6 23REFFLD(CUSTPR/CNAME *LIBL/CUSTPF)
     A                                  7  2'Address  . . . . .'
     A            CUADRS    R        B  7 23REFFLD(CUSTPR/CSTRT  *LIBL/CUSTPF)
     A                                  8  2'City . . . . . . .'
     A            CUCITY    R        B  8 23REFFLD(CUSTPR/CCITY *LIBL/CUSTPF)
     A                                  9  2'State  . . . . . .'
     A            CUSTE     R        B  9 23REFFLD(CUSTPR/CSTATE *LIBL/CUSTPF)
     A                                 10  2'Zip  . . . . . . .'
     A            CUZIP     R     D  B 10 23REFFLD(CUSTPR/CZIP *LIBL/CUSTPF)
     A                                 23  2'F3=Exit'




 測試方法:CRTPNLGRP CUSTPG
           CRTPF CUSTPF 
           CRTDSPF UIMHELP 
           STRSDA 選 option 3 Test Display file 


沒有留言: