dang, you're good! 
 

Thanks Scott.

---------------------------------
Booth Martin
http://www.martinvt.com
---------------------------------
-------Original Message-------
 
From: RPG programming on the AS400 / iSeries
Date: 10/24/05 16:30:20
To: RPG programming on the AS400 / iSeries
Subject: Re: subfile SFLFOLD/SFLDROP and cursor positioning
 
> I was using both SFLDROP and SFLFOLD on F14 and 21/N21.
> I took F14 out of the RPG code as Folding & Unfolding apparently never
goes
> back to the program anyway.
> Then I took out the SFLDROP line of code in the DDS, and the program still
> folds and unfolds as I want.  I was surprised I didn't need both SFLDROP &
> SFLFOLD, and that I didn't have to code for *in21 in the RPG, except to
eval
> *in21 = MODE after the exfmt.
 
That's true.  The *IN21 is only used when the PROGRAM (rather than the
user) wants to control whether the screen is in fold or drop mode.
 
For example, I've written programs where there's no space for an error
message in the subfile.  So I put the error message on the next line
(using SFLFOLD).  When an error occurs, my program automatically turns
FOLD mode on so that the user will see the error message.  If there are no
errors, it uses SFLDROP so that the error message field isn't displayed.
 
 
> Firstly, I would like the cursor to remain on the same subfile record when
> the screen flips.  For instance, if the cursor is on subfile record 3(line
9
> 10, or 11 of the subfile screen on the unfolded screen I would like to
> press F14 to have the folded view, and have the cursor move up to line
three
> of the subfile screen record.
 
Hmmm... it surprises me that this isn't the default behavior?  If it's not
the default behavior, there's not much you can do about it. As you've
already discovered, control isn't returned to your program when the "fold"
f-key is pressed, so you can't insert logic to handle it.
 
 
> In the opposite direction I would like the same to occur, and in
> addition, show the section of the subfile that has the cursor if the
> cursor happened to be on record 5 through 12 of the subfile screen.
 
Same issue.
 
 
> Secondly, I would like to be able to get the information about the first
> record presently being displayed on the screen, regardless of the location
> of the cursor.
 
You can't get information about the first record on the screen because
control isn't returned to your program.
 
What you may need to do is set SFLFOLD/SFLDROP to a *different* function
key than F14.  For example, maybe set it to F24, and then don't TELL
anyone that SFLFOLD/SFLDROP are F24 so that the user never presses it.
 
Then, set up F14 with CF14.  When control returns to your program because
F14 is pressed, you can get the top RRN of the subfile from the INFDS, you
can use SFLCSRRRN to get the actual record that the cursor was on. You can
use SFLRCDNBR to move the cursor, and you can use *IN21 to switch between
fold and drop.
 
This way, your program DOES have control and it can do whatever it needs
to.
 
Unfortunately, it's a hack, because F24 is still available to do
drop/fold, and you have to hide it from the user so that he uses F14
instead.
 
Hope that makes sense.
 
--

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.