[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Display Without Keyboard Wait

Posted on 2004-11-30
10
Medium Priority
?
1,443 Views
Last Modified: 2012-06-27
Can anyone tell me how to display a DDS screen format (DSPF) without waiting for keyboard input? EXFMT always triggers a keyboard input wait state (DSPW) even without a single input field in the format and requires that the Enter key (or equiv.) be pressed before the next statement in the RPG program is executed. WRITE causes everything to behave as though the format had been displayed but it is not visible.

0
Comment
Question by:bodger
  • 4
  • 4
  • 2
10 Comments
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points
ID: 12712835
bodger:

There are various parts at work. For example, a WRITE can output immediately if the display is created as CRTDSPF DFRWRT(*NO); but the attribute is DFRWRT(*YES) by default at most sites. If necessary, I think you can use CHGDSPF DFRWRT(*NO) against a DSPF that's already been compiled.

But keep in mind that keyboard-buffering can cause <Enter> and other AID-byte generating keystrokes to be placed into the keyboard buffer when you don't expect them. You might need to handle a few dozen buffered keystrokes just to get them cleared out if you have a user who will hit <Enter> a few dozen times just because it seemed that the machine wasn't paying attention (or if someone just bumps the keyboard the wrong way). Consider calling the Set Keyboard Buffering (QWSSETWS) API, a Workstation Support API, to help control this.

There are numerous alternatives, but I suspect this is about as far as you want to go today.

Tom

0
 
LVL 14

Expert Comment

by:daveslater
ID: 12713922
Hi
code the FRCDTA keyword into the DDS
then simply use the Write and NOT EXFMT in the RPG

Dave
0
 
LVL 14

Expert Comment

by:daveslater
ID: 12714268
Hi Bodger
I am reading your past two questions as part of the same system design.

I am guessing that you are doing some type of automatic refresh system (like an airport departure screen).

On way to do such a system is via an DATAQ attached to your display file, this give you the flexibility to  test on a normal screen and make live on a remote screen.

You can then update your screen with remote data added from the DATAQ.

This will save the need for DLYJOB and the FRCDTA method that you are going to use.

Let me know if you are interested

Dave
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 

Author Comment

by:bodger
ID: 12716611
Tom

DFRWRT(*NO) sorts it. Thankyou.

----------------------------------------

Dave

You are quite right about the nature of the project, although it's not actually an airport. I will look into DATAQs and thanks for the suggestion. I guess if I have any questions about the subject I can submit them separately.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 12720114
bodger:

An auto-refresh... With or without input from the user?

If it is purely a refresh of a screen such as airport arrival/departure times, you might not use a dtaq. But if the screen indeed expects a user to enter data or any function keys while auto-refresh is also active, then a dtaq is an excellent addition to the project.

I've had projects where multiple displays were used. The user sat at one keyboard/monitor and additional info was displayed on secondary monitors. The secondary monitors were display-only, never accepting input but only displaying secondary info. (9-1-1 emergency dispatch systems where secondary screens would show info about hazardous materials in the area of a fire or where owner info might be displayed from county property databases or whatever)

No dtaq needed, no need to ever care about input from those devices -- just discard everything that could possibly show up.

But an auto-refresh with input -- the dtaq entry acts as an event that triggers the READ in the program. Very handy.

Tom
0
 

Author Comment

by:bodger
ID: 12720398
Tom

At the display point there will be no keyboard. The display program is run from a jobq and ACQs a signed off terminal whose device id is passed as a pgm parm and then proceeds to cycle around a datafile, periodically rebuilding the subfile with the next datafile segment. This part now works just great.

It will be controlled remotely, at the very least to terminate it, using either a MSGQ or an inter-program comms file.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 12721187
You wouldn't happen also to be a COBOL programmer? COBOL has a slick option on its WRITE statement that allows controlling rolling the screen. Pretty cool, not like a subfile at all.

  WRITE  Scr-Rcd  FORMAT 'F1'
     AFTER ROLLING  Top-of-roll-area
               THRU Bottom-of-roll-area
                        DOWN 1

Assuming the 'F1' format is a single line, then the above statement would roll lines downward starting at the line number in Top-of-roll-area through the line number in Bottom-of-roll-area; after those rolled down one line, the new line would be written. Kind of like inserting a line on the screen. A line at the bottom of the defined roll area would be dropped. Rolled lines are output only.

If Top-of-roll-area is set at the line number that 'F1' is defined, then a handy blank line is created and you get a very rolling list going down the screen.

Haven't seen how to make RPG do the same, though maybe DSM could be used.

Tom
0
 

Author Comment

by:bodger
ID: 12721679
It could be done quite easily, assigning F1 and F2 to scroll a line at a time. You just make the subfile size the same as the display size (i.e. number of datarows) and reload it each time F1 or F2 is pressed.
0
 

Author Comment

by:bodger
ID: 12721707
Actually I'd include a 'scroll factor', which could be reduced to 1 or maxed at display/subfile size, in a popup window and stick to the Roll/Page keys.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 12730279
Note that COBOL 'WRITE... AFTER ROLLING...' scrolls the data *on the screen* not in a subfile; no subfile necessary. COBOL also handles subfiles of course, but subfiles are a very specific beast. Also, COBOL ROLL needs no input from the user such as any F-key. It's totally program controlled, although the action could certainly be requested by F-key.

Also, ROLL can be up or down and it can dynamically roll any lines by any roll count as long as the roll count doesn't exceed the count of lines to be rolled. (Rolling three lines down by ten wouldn't make sense since the roll-area only includes three lines.)

Without reloading and redisplaying, I'm not sure a subfile _can_ be rolled except a page at a time or by using SFLROLVAL. But that still requires someone to press PgUp/PgDn. If there's no user control, AFAIK, reload/redisplay is all there is.

Tom
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question