My error message is not displaying in the window's message subfile. Both the main screen and the window have a message subfile defined. The RPG program defines the pgmq = '*'. Here's the dds
R MSGSFL1 SFL
SFLMSGRCD(24)
@KEY1 SFLMSGKEY
@PGMQ1 SFLPGMQ
R MSGCTL1 SFLCTL(MSGSFL1)
SFLDSP
SFLDSPCTL
SFLINZ
SFLEND
SFLSIZ(0010)
SFLPAG(0001)
@PGMQ1 SFLPGMQ
R MSGSFLW SFL
SFLMSGRCD(15)
@KEYW SFLMSGKEY
@PGMQW SFLPGMQ(276)
R MSGCTLW SFLCTL(MSGSFLW)
OVERLAY
SFLDSP
SFLDSPCTL
SFLINZ
SFLEND
SFLSIZ(0010)
SFLPAG(0001)
WINDOW(STATICW)
@PGMQW SFLPGMQ(276)
Here's the RPG code that processes the window's subfile.
This is the one that does not display when run even though
I see the message in the joblog and it displays in the main window if I don't clear the program message queue.
TestStat begsr
write staticw
dou $fkey = Cancel or Error = *off
write msgctlw
exfmt staticw
eval @pgmq = @pgmqw
eval @key = @keyw
exsr ClrMsg
Validate employee numbers
eval Error = *off
idriver chain pr503af 40
if ihelper1 <> 0
ihelper1 chain pr503af 41
endif
if ihelper2 <> 0
ihelper2 chain pr503af 42
endif
If error, then setup msgsfl
if *in40=*on or *in41=*on or *in42=*on
eval @msgid = 'WFA0001'
call 'QMHSNDPM' P$sndm
eval Error = *on
else
eval driver = idriver
eval helper1 = ihelper1
eval helper2 = ihelper2
endif
enddo
Clear message queue before returning to main program flow
exsr ClrMsg
endsr
Any ideas?
Software/Hardware used:
ASKED:
March 14, 2005 5:43 PM
UPDATED:
October 20, 2009 5:28 AM
Sorry…didn’t see it there before..I’m blind to non-green!
OK..just reminded myself of how I achieve it.
Do you have a skeleton or based on window..if so:
I write the skeleton window first, followed by function keys format, followed by the message subfile, followed by an EXFMT to the window data as follows;
Write Scr02w (skeleton window format)
Write Keys04 (function keys)
Write Messages2 (message subfile in window)
Exfmt ConfrmA (window static data..)
Exsr SR_Clr_Msgqw
This works fine for me.
My window STATICW contain the static data and the function keys. It’s also the window that the msgsfl is “based on”.
These are the steps I take to display –
Write staticw
Write msgctlw
exftm staticw
Am I missing something?
I don’t see it in your post, but do you have an ‘OVERLAY’ keyword on the STATICW record? If not, the message subfile will be erased from the screen with your EXFMT STATICW.
Yes it’s there. I may have missed it when copying things. The window’s keywords are
WINDOW(3 20 17 35)
CF03
CF12
OVERLAY
RMVWDW
Does your ClrMsg routine by any chance do a write the message control record on the main screen? After the EXFMT for the window, you must be careful to only refer to formats that are within the window. I have a separate clear routine that I use for each different window that contains a message subfile.
Here’s the logic for my ClrMsg subrtn. I pass it the pgmq
and key for the window msgsfl and it always occurs AFTER
the write of the screen:
ClrMsg begsr
call ‘QMHRMVPM’ P$clrm
endsr
Without seeing what this does:
…it’s going to be guesswork. First guess is that messages aren’t sent correctly.
Tom