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



Nisha,

You might try using the data structure approach. I have included a test
display file and test RPGLE code below that might be of assistance to you.

Display file:

A DSPSIZ(24 80 *DS3)

A*?¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
A*? WINDOW1 - Search Window window

A*?________________________________________________________________________
A R WINDOW1
A OVERLAY
A WINDOW(3 8 13 62 *NOMSGLIN)
A WDWTITLE((*TEXT ' Tesing
Window ')
A (*COLOR WHT) (*DSPATR RI))

A*?¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
A*? FORMAT1 - Prompt format

A*?________________________________________________________________________
A R FORMAT1
A WINDOW(WINDOW1)
A OVERLAY
A 4 3'Field 1......:'
A #FIELD1 10A B 4 18
A 6 3'Field 2......:'
A #FIELD2 10A B 6 18
A 8 3'Field 3......:'
A #FIELD3 4 0B 8 18EDTCDE(Z)
A 10 3'Field 4......:'
A #FIELD4 6A B 10 18
A 12 3'Press ENTER'
A DSPATR(RI)
A COLOR(WHT)


A*?¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
A*? DUMMYFMT - Dummy format to assume overlay of other display file

A*?________________________________________________________________________
A R DUMMYFMT
A ASSUME
A OVERLAY
A 1 2' '

RPGLE Code:

fMGTESTD CF E WORKSTN

* Data structure of screen fields
d Screen ds
d #FIELD1
d #FIELD2
d #FIELD3
d #FIELD4

* Data structure of SAVED screen fields
d Saved ds qualified
d #FIELD1 like(#FIELD1)
d #FIELD2 like(#FIELD2)
d #FIELD3 like(#FIELD3)
d #FIELD4 like(#FIELD4)

* Variable definitions
d vResponse s 1a inz
d vMessage s 50a

/free

#FIELD1 = 'Value1';
#FIELD2 = 'Value2';
#FIELD3 = 1;
#FIELD4 = 'Val3';
Saved = Screen;

write WINDOW1;
exfmt FORMAT1;

if Screen <> Saved;
vMessage = 'Screen values changed';
dsply vMessage '*EXT' vResponse;
else;
vMessage = 'Screen values NOT changed';
dsply vMessage '*EXT' vResponse;
endif;

*inlr = *on;
return;

/end-free


Nisha wrote on 02/07/2013 12:28:26 AM:

From: Nisha Ramesh <n4nisha@xxxxxxxxx>
To: rpg400-l@xxxxxxxxxxxx,
Date: 02/07/2013 07:05 AM
Subject: How to find whether something is changed in dspf
Sent by: rpg400-l-bounces@xxxxxxxxxxxx

I have a dspf with 25 fields..(not a subfile). I want to do a db update
only when user change some field in screen. If he just hit enter
without
any change,i dont want to update. So how can i know this..since i have
many
fields in dspf,comparing one by one is difficult..any other approach?pls
help
--
This is the RPG programming on the IBM i (AS/400 and 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 copyright@midrange.com.

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