× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Douglas

Can I ask why you want to validate each field at a time?  My personal choice
would be to validate the whole screen once the user pressed Enter and
display all error messages in a MSGSFL, highlighting any fields in error.

However, if you want to use the CHECK(ER) to validate each field as it is
entered, then you can define the file information data structure for the
workstation device and pick up the cursor position from there.  Using that
you can then determine within your program where to position the cursor to.
I'm sorry I can't provide an example for you, my 400 is currently powered
down although I'm sure you can find examples in the archives by searching
for INFDS.

All the best and a Happy New Year

Jonathan
www.astradyne-uk.com


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Douglas W. Palme
Sent: 30 December 2004 17:18
To: RPG programming on the AS400 / iSeries
Subject: Control problem with display file


I have run into a problem in controlling a display file correctly.  Below is
the DSP DDS:

 A*%%TS  SD  20041226  212310  DPALME      REL-V5R2M0  5722-WDS
 A*%%EC
 A                                      DSPSIZ(24 80 *DS3)
 A          R PRTRAENTRY
 A*%%TS  SD  20041225  211712  DPALME      REL-V5R2M0  5722-WDS
 A                                      CF12(12 'F12=EXIT')
 A                                  1  4DATE
 A                                      EDTCDE(Y)
 A                                  1 22'COUNTRY WIDE TRANSPORT SERVICES, I-
 A                                      NC.'
 A                                      COLOR(WHT)
 A                                  1 68USER
 A                                  2 28'PARYOLL TRANSACTION ENTRY'
 A                                  7 27'DATE:'
 A                                  8 26'EMPNO:'
 A            DEMPNO         7S 0I  8 33DSPATR(UL)
 A                                  9 24'LOAD NO:'
 A            DLDNO          7S 0I  9 33DSPATR(UL)
 A                                 10 20'DESCRIPTION:'
 A                                 11 18'GL ACCOUNT NO:'
 A            DGLACTNO       6S 0I 11 33DSPATR(UL)
 A                                      CHECK(ER)
 A                                      CHANGE(20)
 A     71                               ERRMSG('INVALID GL CODE' 71)
 A                                 12 25'AMOUNT:'
 A            DAMT           7S 0I 12 33
 A                                 23 10'F12=EXIT'
 A                                 23 60'F10=UPDATE'
 A            DDESC         30A  I 10 33
 A            DDATE           L  B  7 33DATFMT(*USA)

I am sending this display to the screen with an exfmt command.  The user
then enters the data, date, driver no, load no, description, gl code,
amount.  I need to verify some of the data to make sure that it is correct,
IE: GL Account Code.  so I have set the CHECK(ER) on the DGLACTNO so that it
returns control to the program and verifies the number the user entered.
The problem is I need to reposition the cursosr so that it will continue
with the next line and wait for more input.

Here is the RPG code I have written thus far:

C                   MOVE      *DATE         MYDATE
C                   MOVE      MYDATE        DDATE
C                   DOU       *IN12 = *ON
C                   EXFMT     PRTRAENTRY
 *       VERIFY GL ACCOUNT CODE
C     DGLACTNO      CHAIN     CHTACTS
C                   IF        NOT %FOUND
C                   EVAL      *IN71 = *ON
C                   ELSE
C                   EVAL      DGLACTNO = DGLACTNO
C                   ENDIF
C                   ENDDO
C                   EVAL      *INLR = *ON
C                   RETURN

Any suggestions would be greatly appreciated, because I will need to add in
verification for the load number and driver number before the program is
complete.

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.