× 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 Thu, Nov 26, 2009 at 11:00 AM, David FOXWELL <David.FOXWELL@xxxxxxxxx> wrote:
Hi,

On a display file a user can place the cursor on a line of text and use a function key to display another screen. All this happens in another module but in the same program.

When the procedure returns and the original text is displayed again, the cursor has moved. It is in the same position that it occupied on the screen displayed after using the function key.

Screen 1 line x, column y
F20 goes to data entry screen, first field at line x1, column y1.
F12 returns from the procedure.
Screen 1 line x1, column y1

How do I get the cursor back to its original line and column?

It's been a long time since I did any dspf programming. I know this
worked years ago when I wrote it but no guarantees.

You need this in the control record in the dspf source:
A RTNCSRLOC(&CSRRCD &CSRFLD)

A 43 CSRLOC(CSRROW CSRCOL)

A CSRFLD 10A H

A CSRRCD 10A H

A CSRROW 3S 0H

A CSRCOL 3S 0H

In the rpg pgm you need get the cursor position:

Ddspfds ds

D csrPos 370 371b 0

and before displaying the next screen:
csrrow = %div(csrpos:256);

csrcol = %rem(csrpos:256);

csrloc = *on;

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.