× 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.



This is a multi-part message in MIME format.
--
Arul

This is the sample code for achieving your requirement. This was
published in Club Tech iSeries Programming Tips - September 26, 2002.

************************************************************************
****
1. USING AN ERROR MESSAGE SUBFILE WITH A WINDOW FORMAT
Q: We've recently adopted the use of an error message subfile as the
standard
error reporting technique for interactive RPG programs. The error
message
subfile works fine when I use a standard (full-screen) record format.
However,
I've been unsuccessful in my attempts to use an error message subfile
with a
window. Do you have a technique that will work?

A: You're not the first, nor will you be the last, to experience
confusion when
it comes to windows and error message subfiles. The secret to using an
error
message subfile with a window record format involves window definition
formats
and window reference formats.

A window definition format describes the window attributes such as its
position
on the workstation, its size (number of columns and rows), and border
properties. These represent the most basic window attributes and allow
you to
define a simple window format. A more complex window would contain more
information.

A window reference format doesn't describe these attributes. Instead, it

references the window definition format to obtain the attributes.
Perhaps an
example will make this clearer. Consider the following display file used
as a
pop-up window used to look up customer types.


      *  ==============================================================
      *  = Sample display file with message subfile in a window       =
      *  ==============================================================

     A                                      INDARA

      *  --------------------------------------------------------------
      *  -  Window definition format with function key legend         -
      *  --------------------------------------------------------------

     A          R WINDOW1                   WINDOW(3 8 18 54 *NOMSGLIN)
     A                                      OVERLAY
     A                                      WDWTITLE((*TEXT +
     A                                      'Customer Types') +
     A                                      (*COLOR WHT))
     A                                 17  1'F12=Cancel'
     A                                      COLOR(BLU)

      *  --------------------------------------------------------------
      *  -  Subfile record format                                     -
      *  --------------------------------------------------------------

     A          R RCDSFL                    SFL
     A  61                                  SFLNXTCHG
     A            SELECTFLD      1   B  5  4
     A            CUSTTYPE      10   O  5 11
     A            TYPEDESC      30   O  5 19

      *  --------------------------------------------------------------
      *  -  Subfile control record format                             -
      *  --------------------------------------------------------------

     A          R RCDCTL                    CA12(12)
     A                                      SFLCTL(RCDSFL)
     A                                      WINDOW(WINDOW1)
     A                                      OVERLAY
     A  31                                  SFLDSP
     A  31                                  SFLDSPCTL
     A  32                                  SFLCLR
     A                                      SFLSIZ(12)
     A                                      SFLPAG(11)
     A  99                                  SFLEND(*MORE)
     A                                  2  2'Select'
     A                                      COLOR(WHT)
     A                                  2 11'Type'
     A                                      COLOR(WHT)
     A                                  2 19'Description'
     A                                      COLOR(WHT)
     A            SFLRCDNBR      4S 0H      SFLRCDNBR(CURSOR)

      *  --------------------------------------------------------------
      *  -  Error message subfile control record format               -
      *  --------------------------------------------------------------

     A          R MSGSFL                    SFL
     A                                      SFLMSGRCD(18)
     A            MSGKEY                    SFLMSGKEY
     A            PGMQ                      SFLPGMQ

      *  --------------------------------------------------------------
      *  -  Error message subfile control                             -
      *  --------------------------------------------------------------

     A          R MSGCTL                    SFLCTL(MSGSFL)
     A                                      WINDOW(WINDOW1)
     A                                      OVERLAY
     A                                      SFLDSP
     A                                      SFLDSPCTL
     A                                      SFLINZ
     A  99                                  SFLEND
     A                                      SFLSIZ(0002)
     A                                      SFLPAG(0001)
     A            PGMQ                      SFLPGMQ(10)

      *  --------------------------------------------------------------
      *  -  Dummy record format to prevent background erasure         -
      *  --------------------------------------------------------------

     A          R DUMMY                     ASSUME
     A                                  1  2' '


The first record format, Window1, is a record definition format. Notice
that it
contains the aforementioned window attributes (specified with keyword
Window)
along with argument *NoMsgLin to prevent display management from
reserving a
line for messages and the function key legend from appearing when using
the
format.

The next format, RcdSfl, is the subfile that contains the customer type
and its
description along with an input-capable field used to select an entry.

RcdCtl is the format used as the subfile control format for subfile
RcdSfl, and
it appears next. Notice that this format contains keyword Window.
However,
rather than specify the window attributes with this keyword, I've
specified that
display management should reference format Window1 (making RcdCtl a
window
reference format) when displaying the subfile control format. The
subfile
consequently displays in a window with the attributes specified in
format
Window1.

The message subfile, MsgSfl, appears next. There's nothing special about
this
subfile format, but notice that keyword SflMsgRcd specifies that the
messages
should appear on line 18.

Next appears MsgCtl, the subfile control format for message subfile
MsgSfl.
Notice that this format is also a window reference format and that it
too names
format Window1 as the window to reference for attributes. This causes
the
message to appear on line 18 (specified by keyword SflMsgRcd in format
MsgSfl)
of the window.

In RPG, you use the following sequence to display the subfile with the
error
messages in the window:

  1. Load the subfile.
  2. Set any indicator conditions such as indicator 31 to display
subfile RcdSfl
     and subfile control format RcdCtl.
  3. Write format Window1. (This must be done before writing any window
     reference formats.)
  4. Write MsgCtl to display any messages in the program message queue.
  5. ExFmt RcdCtl to actually display and read subfile RcdSfl and
control
     format RcdCtl.

************************************************************************
****

Thanks & Regards
Shiva

-----Original Message-----
From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On Behalf Of Arulanandham_R
Sent: Monday, September 30, 2002 9:55 PM
To: rpg400-l@midrange.com
Subject: Windowed Message subfile

Hi,

   I am arul, i have been working in as/400 for past 1 year.
   Now my problem is i wanted to put a message subfile in my window
which is
already associated with my subfile
   How would i do that??

Arul

Live each and every second
And don't forget to smile

************************************************************************
**
This email (including any attachments) is intended for the sole use of
the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
or
distribution or forwarding of any or all of the contents in this message
is
STRICTLY PROHIBITED. If you are not the intended recipient, please
contact
the sender by email and delete all copies; your cooperation in this
regard
is appreciated.
************************************************************************
**
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
**************************Disclaimer**************************************************

 Information contained in this E-MAIL being proprietary to Wipro Limited is 
'privileged'
and 'confidential' and intended for use only by the individual or entity to 
which it is
addressed. You are notified that any use, copying or dissemination of the 
information
contained in the E-MAIL in any manner whatsoever is strictly prohibited.

****************************************************************************************





As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.