online programming in RPG

online programming in RPG

Post by John Reill » Sun, 31 Oct 1999 04:00:00



Can some one give me an example of how to program the following in RPG.
I have an exfmt in a loop(F3), if the user presses F6 to update a record
I would like to give them a message to press enter to confirm update
otherwise they would cancel or end.  F3 is the end key. My problem seems
to be getting the messages to display at the right time.  Sorry I don't
have code with me.

                                          Do while F3 = 0

                                                Exfmt screen1
                                                chain to get data from
user input
                                          if F6 is = 1
                                             send message to confirm
update
                                             updat record
                                         else
                                             redisplay screen ?
                                         endif
                                          if update occurs rediplay new
data

                                          enddo

 
 
 

online programming in RPG

Post by Pepe » Tue, 02 Nov 1999 04:00:00


Error: Indicator to be set *ON whe errors in entered values.
Message: Indicator to be set *ON when validations are OK and ready to
confirm.

D Error                    S                N
D Message              S                N

* Display screen until user presses F3.
DOU            F3

* If errors in data validation, display error.
IF                Error
Display error
ENDIF

* If no erros in data validation and F6 pressed, display confirmation
message.
IF                Message
Display confirmation message
ENDIF

* Display screen and clear error indicator.
EXFMT       YourFormat
CLEAR        Error

* If user doesn't press F3, keep going.
IF                NOT F3

* If user presses F6, validate data.
IF                F6
* Reset Message indicator and validate data.  If no errors set Message *ON
so the program will display the confirmation message.
CLEAR        Message
If errors in validations, set Error *ON
Else Set Message *ON
* If no F6 but Enter pressed, check if validation of data was OK.
ELSE
* If validation of data was OK when F6 was pressed update the file.
IF                Message
UPDATE     Record
* Clear Message and screen fields for next input operation
CLEAR        Message
CLEAR        Screen
ENDIF

ENDIF

ENDIF

ENDDO

EVAL            *INLR = *ON
RETURN


Quote:> Can some one give me an example of how to program the following in RPG.
> I have an exfmt in a loop(F3), if the user presses F6 to update a record
> I would like to give them a message to press enter to confirm update
> otherwise they would cancel or end.  F3 is the end key. My problem seems
> to be getting the messages to display at the right time.  Sorry I don't
> have code with me.


 
 
 

1. Free RPG/III to RPG/IV conversion tool and more, Now online!

I posted a few months ago about shareware I had writtend.  Unfortunatly
I didn't have access to placing these tools on my page to download.  

Well, now they are there!  Feel free to download any or all of them and
try them out.  V3R1 is the only requirement for these tools.  If enough
people request these tools be made available for V2R3, I will do so
(except the Conversion tool, for obvious reasons).

Again, feel free to grab these tools.  If you like them and feel nice
and want to send me some money, more power to ya!  Be sure to view the
readme file after uncompressing the zip file for installation
instructions, etc.

Thanks again!

http://prairie.lakes.com/~bvstone/as400sw.html
--
Brad Stone
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

http://prairie.lakes.com/~bvstone
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2. C API for Create Table

3. Looking for RPG Online Reference

4. Q: First call to stored procedure via ODBC

5. AS400 Online SQL, CLP, and RPG Help

6. Consultants Available SAP SD/MM AND DW PM AND 2 QA

7. ILE RPG Tutorial... any online?

8. Granitecanyon News Server Problem

9. Online RPG Courses? - Please Help

10. ILE/RPG Programming Standards

11. rpg programming question

12. RPG Sockets Programming

13. RPG programming