Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize DSPF with buttons

Shulou Source: shulou.com Published: 2022-06-02 04:42:55 11月12日 Update

This article mainly explains "how to achieve DSPF with buttons". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to achieve DSPF with buttons".

In AS400, clicking "buttons" such as OK, single, and multiple selections is relatively rare. But it's also convenient to use it in the right place.

The following through a simple demonstration example, introduce how to achieve, interested friends can refer to. The effect is shown in the attached figure.

1. Create a PF to store the demonstration results. The DDS is as follows

SEU== > TESTPF

* Beginning of data * *

0001.00 A R RTEST

0002.00 A SING 1 0 COLHDG ('single selection')

0003.00 A DUB1 1 0 COLHDG ('multiple selection value 1')

0004.00 A DUB2 1 0 COLHDG ('multiple selection 2')

* End of data * *

2. Build DSPF. The DDS is as follows:

SEU== > TESTDSPF

* Beginning of data * *

0001.00 A CA03 (03 'exit')

0002.00 A R R1

0003.00 A D2 @ 1Y 0H

0004.00 A D1 @ 1Y 0H

0005.00 A S1 1Y 0H

0006.00 A FLD001 2Y 0B 4 18SNGCHCFLD (* RSTCSR * SLTIND (

0007.00 A 3))

0008.00 A CHOICE (1' Test 1')

0009.00 A CHCCTL (1 & S1)

0010.00 A CHOICE (2' Test 2')

0011.00 A CHCCTL (2 & S1)

0012.00 A FLD002 2Y 0B 8 18MLTCHCFLD (* NUMCOL 3)

0013.00 A CHOICE (1 'multiple 1')

0014.00 A CHCCTL (1 & D1@)

0015.00 A CHOICE (2 'multiple 2')

0016.00 A CHCCTL (2 & D2@)

0017.00 An ENT@ 2Y 0B 12 18PSHBTNFLD

0018.00 A PSHBTNCHC (1'OK')

0019.00 An EXT@ 2Y 0B 12 36PSHBTNFLD

0020.00 A PSHBTNCHC (1 'return')

3. Demo program, the RPG code is as follows:

SEU== > TESTRPG

* Beginning of data * *

0001.00 H*

0002.00 FTESTPF UF An E K DISK

0003.00 FTESTDSPF CF E WORKSTN

0004.00 C EXFMT R1

0005.00 C EVAL SING=FLD001

0006.00 C EVAL DUB1=D1@

0007.00 C EVAL DUB2=D2@

0008.00 C IF ENT@=1

0009.00 C WRITE RTEST

0010.00 C ENDIF

0011.00 C IF EXT@=1

0012.00 C RETURN

0013.00 C ENDIF

0014.00 C SETON LR

* End of data * *

4. After running RPG, check the result with QUERY as follows:

Line. + 1. 2. 3

Single selection value multiple selection value 1 multiple selection value 2

000001 1 1 1

000002 2 1 1

000003 1 1 1

000004 2 1 1

* * End of report *

Thank you for your reading, the above is the content of "how to achieve DSPF with buttons". After the study of this article, I believe you have a deeper understanding of how to achieve DSPF with buttons, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Buttons learning presentation content results tests appropriateness code examples interests places that is ideas situations effects articles more friends knowledge knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Docker Microsoft Huawei vpn