SlideShare a Scribd company logo
Graphical RPG Framework for IBM i 
SilverDev Tutorial 
Build a Grid and its Popup Menu with the RPG Designer
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 2 / 24 
Steps: 
1. Build a new program ............................................................................................................................. 3 
2. FormCreation ........................................................................................................................................ 6 
3. Database Wizard ................................................................................................................................... 8 
4. Add a Pop-Up menu ............................................................................................................................ 10 
5. Saving and compiling the screen ......................................................................................................... 12 
6. RPG source: Build OnClick Events ....................................................................................................... 13 
7. Additional Tools .................................................................................................................................. 16 
8. Whole source ...................................................................................................................................... 17 
9. Compiling the RPG source ................................................................................................................... 19 
10. Create a CLP program.......................................................................................................................... 20 
11. 1st deployment ................................................................................................................................... 22 
12. Result ................................................................................................................................................... 23
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 3 / 24 
- To follow the steps of this tutorial, you have to install SilverDev on your server. 
- You can download a free 60-day trial on: http://www.silverdev.com/silverdev-free-trial.php 
1. Build a new program 
Launch SilverDev Designer and select a context from the menu Tools> Context.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 4 / 24 
If you have selected the silverdemo option when installing SilverDev, the silverdemo context is diplayed in the list. 
Select it and click the OK button. 
Use the « + » icon to create your new program, in the Context tab :
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 5 / 24 
The program appears on the Context tab. 
Double-click the line to access it 
Source and screen will be displayed on the screen. 
The source file is already filled in.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 6 / 24 
2. Form Creation 
Use the “Components” tool window to add a CSFL type component. 
Select the component from the palette and click the form under construction to place it.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 7 / 24 
Use the “Inspector” tool window to modify the properties of the CSFL component. 
The component must be selected (surrounded by black squares). 
Modify the Align property. Select the alClient value. This means that the component takes up the whole of its parent’s space (here, the form). 
Tip: To obtain help regarding the CSFL component, select the component and press F1 to display the on-line help
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 8 / 24 
3. Database Wizard 
To add columns to the CSFL component, you can double-click the component, but here, we will use a tool to import columns from a database file. 
Use this icon indicated to display the “Database wizard” tab. 
In the “Database wizard” tab, use the search tab. 
Search for the SDDMBKS file (press Enter to start the search). 
The list of corresponding files on the server is displayed. 
Double-click the name of a file to display its characteristics. 
A new window opens: select the IDBOOK, TITLE and PRICE fields (use CTRL to select multiple lines), and drag to the form under construction.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 9 / 24 
Another window opens, asking what you want to do. 
Leave the default selection “Add to grid” and click OK. 
Three columns have been created in the CSFL component. 
The properties of these columns have been modified according to the file’s fields. You can change the properties of these columns if you want.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 10 / 24 
4. Add a Pop-Up menu 
In the “Components” tab, select the CPopupMenu component and place it on the form. 
CpopupMenu is represented by a square. 
Double-click the square to add elements to the popup menu. 
Window “Menu Designer” appears. 
Right click and use the “New” option to create a new menu elements.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 11 / 24 
Use the Property Inspector to change the menu element properties: 
- Call it itemRefresh, with the Name property, 
- Set the Caption property to “Refresh" 
Select the CSFL component again and change its PopupMenu property. Select the PopupMenu1 value. 
This means that when a right click is made on the CSFL component, PopupMenu1 will be displayed.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 12 / 24 
5. Saving and compiling the screen 
On the Form menu, Save and compile the form: 
As you can see below, the screen is a *USRSPC type object:
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 13 / 24 
6. RPG source: Build OnClick Events 
First, we declare SDDMBKS books’ table: 
In the RPGSPCIF block reserved for file declarations, 
declare the SDDMBKS file. 
You can also drag the file name 
from the Database Wizard tab 
To display the ruler, press F8.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 14 / 24 
Now we add the OnClick event to the menu element, itemRefresh. Tip: Press F10 to display the screen. 
Double-click the CPopupMenu component and tick the OnClick event of the itemRefresh element. 
Double click the OnClick line: the cursor is now in the source in the itemRefresh_Onclick event.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 15 / 24 
In the itemRefresh_OnClick event, we will read the sddmbks file 
and fill in the CSFL component: 
In the example, the words shown in purple are functions provided with SilverDev. 
They enable the components to be manipulated via the RPG program. 
To see the list of Silverdev functions, press Ctrl+Space to display the list of functions corresponding to the first letters of the word you are typing in.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 16 / 24 
7. Additional Tools 
Press F2: to display the list of the window’s components and properties in a tree structure 
Press Enter: to insert a component or property name 
Press F4: to see a format prompt window
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 17 / 24 
8. Whole source 
// *===============================================================* 
// * Title . . . : * 
// * Author . .ADUVAL * 
// * Date . . .2014-10-21 * 
// * Project . . : * 
// * Description : * 
// * * 
// * * 
// * -Technical data-----------------------------------------------* 
// * * 
// * Main SDF .*LIBL/TUTO1 * 
// * * 
// *===============================================================* 
*/BLOCK RPGSPCIH 
// -------------- RPGSPCIH : H specifications (Heading) 
*/BLOCK RPGSPCIF 
// -------------- RPGSPCIF : Files declarations (F Spec.) 
FSDDMBKS if e k disk 
*/BLOCK RPGSPCID 
// -------------- RPGSPCID : Data descriptions (D Spec.) 
*/BLOCK RPGSPCII 
// -------------- RPGSPCII : Input descriptions (I Spec.) 
*/BLOCK RPGPARM 
// -------------- RPGPARM : Program parameters and declarations (KLIST, DEFINE, ...) 
*/BLOCK RPGPGMSTART 
// -------------- RPGPGMSTART :Begining of Initializations procedure 
*/BLOCK RPGBEFORECREATE 
// -------------- RPGBEFORECREATE : just before form creation 
*/BLOCK RPGAFTERCREATE 
// -------------- RPGAFTERCREATE : After form creation 
*/BLOCK RPGBEFORESHOW 
// -------------- RPGBEFORESHOW: Before show(F1) 
*/BLOCK RPGAFTERSHOW 
// -------------- RPGAFTERSHOW : After show(F1) 
*/BLOCK RPGPROCDEF
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 18 / 24 
// -------------- RPGPROCDEF : User procedures 
*/BLOCK RPGSR 
// -------------- RPGSR : Sub Routine 
*/BLOCK RPGTABLE 
// -------------- RPGTABLE : Compile time array data (**) 
*/EVENT itemRefresh_OnClick 
‚* --------------------------------------------------------------* 
‚* Description : 
‚* --------------------------------------------------------------* 
D Parameters ds based(pevtinf) 
D Win 5u 0 
D Evt 48a 
‚* 
D row s 10u 0 
ccallpsdClear(F1:'SFL1') 
C *lovalsetllsddmbks 
c read sddmbks 
cdow not %eof(sddmbks) 
ceval row = row + 1 
ccallpsdSetCell(F1:'SFL1':'Title':Row:Title) 
ccallpsdSetCellNum(F1:'SFL1':'Price':Row:price) 
ccallpsdSetCellNum(F1:'SFL1':'idbook':Row:idbook) 
c read sddmbks 
cenddo
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 19 / 24 
9. Compiling the RPG source 
Save the modifications made to the source via the “Members/Save member” menu. 
Compile the program using the “Compilation/Generate program” menu. 
If an error occurs during compilation, a dialog box will be displayed. Click OK. 
The compilation results will be displayed in a new window. Compilation errors are shown in bold. 
Double click a line to access the location in the source. When there are no more errors, the program will be created in SILVERDEMO.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 20 / 24 
10. Create a CLP program 
Now, we are going to create a CL program which will add SILVERDEMO to the library list and run our TUTO1EN program. Write it as usual: 
Or in SilverDev editor: 
Open a New Member in the menu Members 
And write your program: 
Save it in the menu Members/Save Member 
Don’t forget to change the source type in CLP
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 21 / 24 
And compile in the menu Compiling / Create a program:
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 22 / 24 
11. 1st deployment 
To make the application available, you must have administrator rights. Check that your profile is in the SILVERDEV/PSVDADM file. 
Launch MyDesk and right click where you want to make your application available. Then, choose « New application » 
Fill the dialog box with the application title, the file name and the call command. 
On next screen, select the app authorizations.
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 23 / 24 
12. Result 
An icon is now shown in MyDesk: The application is available. 
Double click the icon to start the application that we have just created. Once the application is running, right click on the form and click “Refresh”. 
The grid appears. You can sort it by clicking on the column headers
SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer 
Experia -- Reproduction Rights Reserved -- 24 / 24 
More info on www.silverdev.com 
EXPERIA Europe 
4, rue L.Beridot 
Les jardins d'Epione 
38500 VOIRON - FRANCE 
www.experia.com 
info@experia.com

More Related Content

PDF
[Tutorial] SilverDev Wizard - english
PDF
Experia annonce la nouvelle version de SilverDev pour AS400 / IBM i
PDF
[Tutoriel] SilverDev Wizard - français
PDF
SilverDev: Modernize Your IBM i User Experience
PDF
RPG : Développez des applications graphiques avec Silverdev
PDF
[Tutorial] Build a graph in RPG with SilverDev
PDF
[Tutorial] SilverDev for IBM i: Quick Start
PDF
The Ring programming language version 1.2 book - Part 36 of 84
[Tutorial] SilverDev Wizard - english
Experia annonce la nouvelle version de SilverDev pour AS400 / IBM i
[Tutoriel] SilverDev Wizard - français
SilverDev: Modernize Your IBM i User Experience
RPG : Développez des applications graphiques avec Silverdev
[Tutorial] Build a graph in RPG with SilverDev
[Tutorial] SilverDev for IBM i: Quick Start
The Ring programming language version 1.2 book - Part 36 of 84

Similar to [Tutorial] SilverDev Designer - RPG Development Studio (19)

PDF
The Ring programming language version 1.5.3 book - Part 48 of 184
PDF
The Ring programming language version 1.5.3 book - Part 58 of 184
PDF
The Ring programming language version 1.3 book - Part 38 of 88
PDF
The Ring programming language version 1.4 book - Part 14 of 30
PDF
The Ring programming language version 1.5.4 book - Part 48 of 185
PDF
Game Programming I - GD4N
PDF
[Tutorial] Insert a Picture in IBM i Applications with SilverDev
PDF
Using FireMonkey as a game engine
PDF
The Ring programming language version 1.7 book - Part 53 of 196
PDF
2016_Work_Samp_MFriehauf-Penton-md
PDF
The Ring programming language version 1.5.2 book - Part 47 of 181
PPT
Extracts from AS/400 Concepts & Tools workshop
PDF
The Ring programming language version 1.6 book - Part 50 of 189
PDF
Jogos em Perl
PPTX
C game programming - SDL
PDF
The Ring programming language version 1.9 book - Part 58 of 210
PPTX
WP7 HUB_Introducción a Silverlight
PDF
The Ring programming language version 1.5.1 book - Part 47 of 180
PDF
The Ring programming language version 1.8 book - Part 55 of 202
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.5.4 book - Part 48 of 185
Game Programming I - GD4N
[Tutorial] Insert a Picture in IBM i Applications with SilverDev
Using FireMonkey as a game engine
The Ring programming language version 1.7 book - Part 53 of 196
2016_Work_Samp_MFriehauf-Penton-md
The Ring programming language version 1.5.2 book - Part 47 of 181
Extracts from AS/400 Concepts & Tools workshop
The Ring programming language version 1.6 book - Part 50 of 189
Jogos em Perl
C game programming - SDL
The Ring programming language version 1.9 book - Part 58 of 210
WP7 HUB_Introducción a Silverlight
The Ring programming language version 1.5.1 book - Part 47 of 180
The Ring programming language version 1.8 book - Part 55 of 202
Ad

More from SilverDev by Experia (12)

PDF
[Tutoriel] Créez un graph en RPG avec SilverDev
PDF
[Tutorial] Crear gráficos en RPG con SilverDev
PDF
[Tutoriel] Insérer une image dans une application IBM i avec SilverDev
PDF
[Tutorial] Insertar una imagen en una aplicación IBM i con SilverDev
PDF
[Tutoriel] SilverDev pour IBM i : Démarrage rapide
PDF
Comment simplifier et améliorer l'interfaçage IBM i / PC?
PDF
How to simplify IBM i / PC exchanges with SilverDev?
PDF
IBM i: How modernized applications facilitate interactions with PCs?
PDF
Témoignage Igloo Post-Mix (Orangina-Schweppes / Pepsi Cola)
PDF
SilverDev / ARCAD Skipper Interface - for Structured Graphic Developments in ...
PDF
Temoignage SilverDev - Moderniser l’existant en RPG avec SilverDev
PDF
[Tutoriel] Studio de développement RPG SilverDev Designer
[Tutoriel] Créez un graph en RPG avec SilverDev
[Tutorial] Crear gráficos en RPG con SilverDev
[Tutoriel] Insérer une image dans une application IBM i avec SilverDev
[Tutorial] Insertar una imagen en una aplicación IBM i con SilverDev
[Tutoriel] SilverDev pour IBM i : Démarrage rapide
Comment simplifier et améliorer l'interfaçage IBM i / PC?
How to simplify IBM i / PC exchanges with SilverDev?
IBM i: How modernized applications facilitate interactions with PCs?
Témoignage Igloo Post-Mix (Orangina-Schweppes / Pepsi Cola)
SilverDev / ARCAD Skipper Interface - for Structured Graphic Developments in ...
Temoignage SilverDev - Moderniser l’existant en RPG avec SilverDev
[Tutoriel] Studio de développement RPG SilverDev Designer
Ad

Recently uploaded (20)

PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
project resource management chapter-09.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Chapter 5: Probability Theory and Statistics
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
August Patch Tuesday
PPTX
A Presentation on Artificial Intelligence
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Getting Started with Data Integration: FME Form 101
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
1. Introduction to Computer Programming.pptx
Hindi spoken digit analysis for native and non-native speakers
Building Integrated photovoltaic BIPV_UPV.pdf
project resource management chapter-09.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Programs and apps: productivity, graphics, security and other tools
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 5: Probability Theory and Statistics
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Group 1 Presentation -Planning and Decision Making .pptx
DP Operators-handbook-extract for the Mautical Institute
August Patch Tuesday
A Presentation on Artificial Intelligence
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Getting Started with Data Integration: FME Form 101
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
1. Introduction to Computer Programming.pptx

[Tutorial] SilverDev Designer - RPG Development Studio

  • 1. Graphical RPG Framework for IBM i SilverDev Tutorial Build a Grid and its Popup Menu with the RPG Designer
  • 2. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 2 / 24 Steps: 1. Build a new program ............................................................................................................................. 3 2. FormCreation ........................................................................................................................................ 6 3. Database Wizard ................................................................................................................................... 8 4. Add a Pop-Up menu ............................................................................................................................ 10 5. Saving and compiling the screen ......................................................................................................... 12 6. RPG source: Build OnClick Events ....................................................................................................... 13 7. Additional Tools .................................................................................................................................. 16 8. Whole source ...................................................................................................................................... 17 9. Compiling the RPG source ................................................................................................................... 19 10. Create a CLP program.......................................................................................................................... 20 11. 1st deployment ................................................................................................................................... 22 12. Result ................................................................................................................................................... 23
  • 3. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 3 / 24 - To follow the steps of this tutorial, you have to install SilverDev on your server. - You can download a free 60-day trial on: http://www.silverdev.com/silverdev-free-trial.php 1. Build a new program Launch SilverDev Designer and select a context from the menu Tools> Context.
  • 4. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 4 / 24 If you have selected the silverdemo option when installing SilverDev, the silverdemo context is diplayed in the list. Select it and click the OK button. Use the « + » icon to create your new program, in the Context tab :
  • 5. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 5 / 24 The program appears on the Context tab. Double-click the line to access it Source and screen will be displayed on the screen. The source file is already filled in.
  • 6. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 6 / 24 2. Form Creation Use the “Components” tool window to add a CSFL type component. Select the component from the palette and click the form under construction to place it.
  • 7. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 7 / 24 Use the “Inspector” tool window to modify the properties of the CSFL component. The component must be selected (surrounded by black squares). Modify the Align property. Select the alClient value. This means that the component takes up the whole of its parent’s space (here, the form). Tip: To obtain help regarding the CSFL component, select the component and press F1 to display the on-line help
  • 8. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 8 / 24 3. Database Wizard To add columns to the CSFL component, you can double-click the component, but here, we will use a tool to import columns from a database file. Use this icon indicated to display the “Database wizard” tab. In the “Database wizard” tab, use the search tab. Search for the SDDMBKS file (press Enter to start the search). The list of corresponding files on the server is displayed. Double-click the name of a file to display its characteristics. A new window opens: select the IDBOOK, TITLE and PRICE fields (use CTRL to select multiple lines), and drag to the form under construction.
  • 9. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 9 / 24 Another window opens, asking what you want to do. Leave the default selection “Add to grid” and click OK. Three columns have been created in the CSFL component. The properties of these columns have been modified according to the file’s fields. You can change the properties of these columns if you want.
  • 10. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 10 / 24 4. Add a Pop-Up menu In the “Components” tab, select the CPopupMenu component and place it on the form. CpopupMenu is represented by a square. Double-click the square to add elements to the popup menu. Window “Menu Designer” appears. Right click and use the “New” option to create a new menu elements.
  • 11. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 11 / 24 Use the Property Inspector to change the menu element properties: - Call it itemRefresh, with the Name property, - Set the Caption property to “Refresh" Select the CSFL component again and change its PopupMenu property. Select the PopupMenu1 value. This means that when a right click is made on the CSFL component, PopupMenu1 will be displayed.
  • 12. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 12 / 24 5. Saving and compiling the screen On the Form menu, Save and compile the form: As you can see below, the screen is a *USRSPC type object:
  • 13. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 13 / 24 6. RPG source: Build OnClick Events First, we declare SDDMBKS books’ table: In the RPGSPCIF block reserved for file declarations, declare the SDDMBKS file. You can also drag the file name from the Database Wizard tab To display the ruler, press F8.
  • 14. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 14 / 24 Now we add the OnClick event to the menu element, itemRefresh. Tip: Press F10 to display the screen. Double-click the CPopupMenu component and tick the OnClick event of the itemRefresh element. Double click the OnClick line: the cursor is now in the source in the itemRefresh_Onclick event.
  • 15. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 15 / 24 In the itemRefresh_OnClick event, we will read the sddmbks file and fill in the CSFL component: In the example, the words shown in purple are functions provided with SilverDev. They enable the components to be manipulated via the RPG program. To see the list of Silverdev functions, press Ctrl+Space to display the list of functions corresponding to the first letters of the word you are typing in.
  • 16. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 16 / 24 7. Additional Tools Press F2: to display the list of the window’s components and properties in a tree structure Press Enter: to insert a component or property name Press F4: to see a format prompt window
  • 17. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 17 / 24 8. Whole source // *===============================================================* // * Title . . . : * // * Author . .ADUVAL * // * Date . . .2014-10-21 * // * Project . . : * // * Description : * // * * // * * // * -Technical data-----------------------------------------------* // * * // * Main SDF .*LIBL/TUTO1 * // * * // *===============================================================* */BLOCK RPGSPCIH // -------------- RPGSPCIH : H specifications (Heading) */BLOCK RPGSPCIF // -------------- RPGSPCIF : Files declarations (F Spec.) FSDDMBKS if e k disk */BLOCK RPGSPCID // -------------- RPGSPCID : Data descriptions (D Spec.) */BLOCK RPGSPCII // -------------- RPGSPCII : Input descriptions (I Spec.) */BLOCK RPGPARM // -------------- RPGPARM : Program parameters and declarations (KLIST, DEFINE, ...) */BLOCK RPGPGMSTART // -------------- RPGPGMSTART :Begining of Initializations procedure */BLOCK RPGBEFORECREATE // -------------- RPGBEFORECREATE : just before form creation */BLOCK RPGAFTERCREATE // -------------- RPGAFTERCREATE : After form creation */BLOCK RPGBEFORESHOW // -------------- RPGBEFORESHOW: Before show(F1) */BLOCK RPGAFTERSHOW // -------------- RPGAFTERSHOW : After show(F1) */BLOCK RPGPROCDEF
  • 18. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 18 / 24 // -------------- RPGPROCDEF : User procedures */BLOCK RPGSR // -------------- RPGSR : Sub Routine */BLOCK RPGTABLE // -------------- RPGTABLE : Compile time array data (**) */EVENT itemRefresh_OnClick ‚* --------------------------------------------------------------* ‚* Description : ‚* --------------------------------------------------------------* D Parameters ds based(pevtinf) D Win 5u 0 D Evt 48a ‚* D row s 10u 0 ccallpsdClear(F1:'SFL1') C *lovalsetllsddmbks c read sddmbks cdow not %eof(sddmbks) ceval row = row + 1 ccallpsdSetCell(F1:'SFL1':'Title':Row:Title) ccallpsdSetCellNum(F1:'SFL1':'Price':Row:price) ccallpsdSetCellNum(F1:'SFL1':'idbook':Row:idbook) c read sddmbks cenddo
  • 19. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 19 / 24 9. Compiling the RPG source Save the modifications made to the source via the “Members/Save member” menu. Compile the program using the “Compilation/Generate program” menu. If an error occurs during compilation, a dialog box will be displayed. Click OK. The compilation results will be displayed in a new window. Compilation errors are shown in bold. Double click a line to access the location in the source. When there are no more errors, the program will be created in SILVERDEMO.
  • 20. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 20 / 24 10. Create a CLP program Now, we are going to create a CL program which will add SILVERDEMO to the library list and run our TUTO1EN program. Write it as usual: Or in SilverDev editor: Open a New Member in the menu Members And write your program: Save it in the menu Members/Save Member Don’t forget to change the source type in CLP
  • 21. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 21 / 24 And compile in the menu Compiling / Create a program:
  • 22. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 22 / 24 11. 1st deployment To make the application available, you must have administrator rights. Check that your profile is in the SILVERDEV/PSVDADM file. Launch MyDesk and right click where you want to make your application available. Then, choose « New application » Fill the dialog box with the application title, the file name and the call command. On next screen, select the app authorizations.
  • 23. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 23 / 24 12. Result An icon is now shown in MyDesk: The application is available. Double click the icon to start the application that we have just created. Once the application is running, right click on the form and click “Refresh”. The grid appears. You can sort it by clicking on the column headers
  • 24. SilverDev Tutorial – Build a Grid and its Popup Menu with the RPG Designer Experia -- Reproduction Rights Reserved -- 24 / 24 More info on www.silverdev.com EXPERIA Europe 4, rue L.Beridot Les jardins d'Epione 38500 VOIRON - FRANCE www.experia.com info@experia.com