tnt400.com - AS/400 Tips And Techniques

Sponsored by news400.com

This page is a discussion on the mentioned topic.
Most of the answers are in their original posted form, including any technical/spelling/grammatical errors.
No guarantees are expressed or implied. :-)
Comments, corrections, concerns about this tip?

Got another AS/400 question? Ask it here


What's New?
See what's new at Tips-N-Tech.

AS/400 Tips-N-Tech
AS/400 tips, techniques, and FAQ. Updated frequently.
CODEPage/400
All the code samples you can eat! RPG, CL, DDS, etc. etc.
AS/400 FAQs
The official news400.com FAQs.






All AS/400 Tip Categories / AS/400 Programming / Subfile Window background problem


Question:

IBMers Please help ... window background I know it as been discussed more than often! But I still don’t know the right solution! Although I’ve tried almost anything! Why do I get an OLD or totally EMPTY background for my windows the second time I display them? I prefer to end my RPGLE program with RETURN. There for I’ve tried to open my displayfile USER CONTROLLED ... no solution when calling the same window from more than one processed subfile record of the main program! I’ve expirmented with the USRRSTDSP keyword, no use ... Could somebody please help my out ... Thanks Ron =================================== See here my window example: PS The dummy record "WINDOW" is not really used within my program. PS The field *RTNUMM and *VTRVLG are numeric 6,0 and 3,0.
A*****************************************************************
A* Create DisplayFile Keywords:
A* CRTDSPF RSTDSP(*YES)
A*****************************************************************
A                                      DSPSIZ(24 80 *DS3)
A                                      REF(*LIBL/@FRF FRFR)
A                                      PRINT(*LIBL/QSYSPRT)
A                                      ALTHELP(CA01)
A                                      HELP
A                                      HLPSCHIDX(*LIBL/@IDX)
*****************************************************************
* DUMMY WINDOW RECORD TBV ASSUME
*****************************************************************
A          R WINDOW
A                                      ASSUME
A            #PGMID        10      1  2
A*****************************************************************
A* SELECT Display X1
A*****************************************************************
A          R SLCTX1
A                                      WINDOW(MSGCTLX)
A                                      CF04
A                                      CF06
A                                      CF12
A                                      CF18
A                                      CF23
A                                      CF24
A                                      VLDCMDKEY(55 'Valid command
key')
A                                      CSRLOC(#ROW       #COL)
A                                      RTNCSRLOC(&#CSRRCD &#CSRFLD
&#CSRPO-
A                                      S)
A                                      CHANGE(40 'SLCTX1 Changed')
A                                      OVERLAY
A            #ROW           3S 0H
A            #COL           3S 0H
A            #CSRRCD       10A  H
A            #CSRFLD       10A  H
A            #CSRPOS        4S 0H
A            $1RTNUMM  R        O  5 32REFFLD(@@RTNUMM)
A            $1VTRVLG  R        B  6 35REFFLD(@@VTRVLG)
A  80                                  DSPATR(PC)
A  80                                  DSPATR(RI)
A     69                               DSPATR(ND) DSPATR(PR)
A            $2VTRVLG  R        B  6 52REFFLD(@@VTRVLG)
A  81                                  DSPATR(PC)
A  81                                  DSPATR(RI)
A     69                               DSPATR(ND) DSPATR(PR)
A            $2RTNUMM  R        B  8 32REFFLD(@@RTNUMM)
A  82                                  DSPATR(PC)
A  82                                  DSPATR(RI)
A            $3VTRVLG  R        B  9 35REFFLD(@@VTRVLG)
A  83                                  DSPATR(PC)
A  83                                  DSPATR(RI)
A*****************************************************************
A* MESSAGE Subfile Record X
A*****************************************************************
A          R MSGSFLX                   SFL
A                                      SFLMSGRCD(12)
A            #MSGK                     SFLMSGKEY
A            #PGMQ                     SFLPGMQ(10)
A*****************************************************************
A* MESSAGE Subfile Control X
A*****************************************************************
A          R MSGCTLX                   SFLCTL(MSGSFLX)
A                                      OVERLAY
A  44                                  SFLDSP
A  44                                  SFLDSPCTL
A  44                                  SFLINZ
A  44                                  SFLEND
A                                      SFLSIZ(0002)
A                                      SFLPAG(0001)
A                                      USRRSTDSP
A                                      WINDOW(*DFT 12 55 *NOMSGLIN)
A                                      WDWBORDER((*COLOR BLU) (*CHAR
'...:-
A                                      ::.:'))
A            #PGMQ                     SFLPGMQ(10)
A*****************************************************************



Answer(s):



>There for I’ve tried to open my displayfile USER CONTROLLED ... This work !! always remember, you have to open the Display file as you entre the program and close it before the RETRN. I've done this several time: works fine. Btw, if someone know a better way... or. if IBM is thinking about fixing this hole...




There are other implications of changing RSTDSP to *NO that may present some problems to you. If you have any attention key programs that open display files, or message break handling programs that open display files, then you *MUST* use RSTDSP(*YES) otherwise your display files will not be properly restored when the attention or break handling programs finish. The only solution I have found when RSTDSP(*YES) is specified, is to have the window display file opened at program start and closed at program end. Setting LR on when your program finishes, automatically closes any files for you. If you simply want to RETRN then you must explicitly close the window display file. BTW, if your window display file as the KEEP keyword specified, then this prevents the display file from being fully closed, so take it out if it is there.




It's in the RSTDSP(*YES) parameter. When the window is first displayed, the background over which it is displayed is saved. The next time it is displayed, the saved background is restored. You can try it out with CHGDSPF RSTDSP(*YES|*NO).





Other tips in this category:

Click here to see all categories.

Socket Programming And Timeout Issues
Deleting Duplicate Records From A Table
What are data queues and how to use
Retrieving SMTP Name
RPGLE example for Dynamic Screen Manager API
Calling APIs from CL - with examples!
Compare two strings in RPG character by character
How to search all pgms in QCLSRC for a keyword
Retrieve Database File Description (QDBRTVFD) API
How to redirect the output to STDERR from RPG-IV
Using Multiformat Logical To Join 2 Identical File
D-Spec *LIKE DEFN
RPG: Converting Character to Decimal
Example of ILE RPG CGI Program
Handling ILE RPG Numeric Overflow
Help with Subfile Programming in RPG III
Zoned parameter in ILE RPG
What's the best way to do modulus in CL?
RPG Nesting Source Print Utility
More on changing the SIGNON screen
A silly ILE RPG question
Calling Validation List API From ILE RPG
Soft Coding Module Names
RPG Multidimensional Arrays in Action
Build a Page-Equals-Size Lookup Window
Procedures within an ILE RPG program
Break msg from RPG
Source Debugger for batch jobs
RPGLE debugging
Timing out display sessions in DDS
Building Dynamic Stored Procedures
Put Message in System Log
Dynamic RPGSQL
Randomize function for the AS/400
What's the fastest way to do a simple RPG lookup?
First time Data queue application in RPG
Print file overflow in ILE RPG
Mapping Fields To Arrays in ILE RPG
Named inidicators
STRQMQRY: comparision operator '=' isn't correct?!
DSPDTAARA to an outfile - possible?
PCL ESC codes in RPG
Sharing DB files between two AS/400s
Help: AS/400 subfiles
How do you change the signon screen?
Determining Even/Odd Values in queries
Get day of the week in RPG
Convert UPPERCASE to lowercase
RPG IV help using APIs
Help with data area API
Detecing IFS Files from RPG
SQL in a CL program
Calling AS/400 APIs from ILE RPG
CVTDAT command to convert an *MDY to a *LONGJUL
CPYSPLF Automation
Subfile Window background problem
Using IFS APIs w/ ILE RPG
Packed or unpacked fields?
QRYDFN to source and back
What does the "optimize" parm do?
Determining the calling program
Sockets in RPG?
Sorting a user space
OVRDBF and SECURE() keyword in an ILE environment
RPG record locking
RPG Differences: V2R3 to V3R2 upgrade
Getting the relative record number (RRN)
What is the longest parameter usable in RPG?
A C function that returns a string to an RPG pgm
Problems with ZADD *ZEROS
Can you highlight code in SEU?
Reusing deleted records - OK?
Is there an easy way to change edit codes?
Help - Windowed Subfiles
Logical Files and DDS
AS/400 'machine language' - MI Programming
Library lists and performance
How to use ERRSFL
Updating in CL
Record lock wait time
Message subfile problem
Physical File Joins
CL: Copying User Profiles
Commands and PARM
ILE RPG, RPG IV, vs. RPG/400
RPG and subfiles
Multiple subfiles
Field masking for passwords
SFLMODE keyword in an ILE program
Subfile size
Color coding records in a subfile
MSGLINE in windows
Controlling cursor movement on a display file
API returns error! Why?
Put an RPG Program on the Web
Variable length records in RPG
Differences Between RPG400, RPG IV, and ILE RPG


You are at a news400.com site.
Contact Us | Report Bugs | Submit Comments/Suggestions | Read Site Use Agreement | Read Privacy Policy
Copyright © 2000 Duke Communications International.
This site is best viewed with the latest versions of Netscape or Internet Explorer, 800 x 600 resolution (or higher), and at least 256 colors.
Duke Communications   NEWS/400 | 29th Street Press | Business Finance | DominoPro | Selling AS/400 Solutions | SQL Server Magazine | Windows NT Magazine