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



On 2/16/2011 1:39 PM, M. Lazarus wrote:
Thanks all for the suggestions on how to handle different methods
of subfile positioning.

SFLRCDNBR(*TOP) was a contender, but I don't like some of the side
effects, such as when the cursor is in a record other than the first,
that line jumps to the top. I only want that behavior when a
function key is pressed. For this application, that behavior would
be very annoying.

This side effect occurs because of how your set the value in SFLRCDNBR. What you should do is the following pseudo-code:

if topcommandkey;
set sflrcdnbr to current record;
else;
set sflrcdnbr to top record of subfile;
endif;

Also, the cursor always jumps to the input field in the SFCTL
record, unless I explicitly position it at a specific subfile record,
which is also not desirable.

You can have the best of both worlds. If you want to leave the cursor in the same place it was, you can get that information from fields using RTNCSRLOC. You position using CSRLOC. Otherwise, if you want to position using display attributes, you can do that as well:

set CSRLOC indicator off;
if need to position to a specific field;
use indicators for DSPATR(PC);
else if you want to reposition the cursor where it was;
set CSRLOC to values from RTNCSRLOC;
set CSRLOC indicator on;
else;
leave the default to position to the first input-capable field;
endif;


I think my biggest challenge will be to make sure to keep the lines
in sync with the original data set, including multiple repositions by
the user. I don't think that's such a big hurdle to overcome.

Any additional thoughts?

Reloading the subfile seems like a whole lot of work for not a whole lot of benefit. My guess is that if you took the time to create a nice decisions tree for what you wanted the cursor to do that you would be able to use a combination of SFLRCDNBR(*TOP) and RTNCSRLOC/CSRLOC to do what you needed.

Joe


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.