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



Thanks.

Yes, it sort of does. But I thought for sure in the past I was able to
manually change W$KEY when doing different screens in the same display file.

The F12 thing is probably what I will have to do. The issue is sometimes
when an option is taken I just display a new screen in the same display
file, and others I call another program so F3 will work differently for
different options (if that makes any sense) since the F3 from a
called program isn't passed back either.

It's just a simple subfile screen but I just don't remember it doing that
before.

On Tue, Mar 7, 2023 at 10:25 AM <smith5646midrange@xxxxxxxxx> wrote:

I can't explain why but this is normal behavior as far as I can remember.
As I recall w$key (and maybe the entire INFDS) is only "updated" during a
read. Writes put the original value back into w$key (and maybe the entire
INFDS).

I typically have F3 exit the program (no matter what screen the user is on)
and F12 go back a screen. I create an indicator variable named EndOfTime
and my DOW looks at it. When they hit F12, I leave the loop. When they
hit
F3, I turn on EndOfTime and leave the loop. I never rely on the variables
in the INFDS after a write, open, or close is executed. I've been doing it
this way for 20 years so the exact reasons have been purged from my brain.

Not sure if that helps.

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Brad
Stone
Sent: Tuesday, March 7, 2023 10:18 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
<rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Function Key on Subfile Program

It's been years since I've written a subfile program, but I have a
question.

The program has a subfile (SFL01, CTL01, OVR01) as well as another screen
(SCR01).

The F3 key is defined on the subfile as well as the screen.

SCR01 is displayed when they take an option on a subfile record. The
screen
is displayed and if they hit F3 we come back to the loop displaying the
subfile. F5 (refresh) is forced into the function key so the subfile is
refresh, but for some reason when we are initializing the subfile (writing
the CTL01 record) it's getting set back to F3, so then it exits the program
all together.

FGGFAS1D CF E WORKSTN
F SFILE(SFL01:RRN)
F INFDS(WDSUBF)
D WDSUBF DS
D W$KEY 369 369
D SFLPG# 378 379B 0

So, the W$KEY is what we check to see what function key they pressed. It's
x'40' on startup.

They go into the SCR01 and press F3 and it's x'33'. The value x'35' (F5)
is
being forced into it so the subfile is refreshed... but during this code,
it's set back to x'33'.

C eval RRN = 0
C MOVEA '0010' *IN(31)
C WRITE CTL01
C MOVEA '0100' *IN(31)

The WRITE operation is where it gets set back. And of course that causes
it
to exit out all together (which we don't want to happen).

I don't recall this happening before.. then again, it's been years since
I've done a subfile. :)

Bradley V. Stone
www.bvstools.com
Native IBM i e-Mail solutions for Microsoft Office 365, Gmail, or any Cloud
Provider!
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.


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

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.



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.