Precisely Speaking
May 21, 2012, 06:40:08 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Mimic Function Key  (Read 797 times)
Thomas
Professional
***
Posts: 21


« on: October 14, 2010, 09:45:29 AM »

I have an output screen with F7 set up in the 'Function Key/Action Bar Definitions' to run a process that updates and refreshes the screen.  That works great, as it does exactly what I want it to.

However, since this is a screen, which is supposed to allow the user to monitor something, I can't have the user sit there all day and press F7 every 5 seconds.

How would I mimic this function key press so that there it does not require not user input?
Logged

* Government is not the solution to our problem; government is the problem - Ronald Wilson Reagan
* Democrats are the party of food stamps and Republicans are the party of paychecks. - Newt Gingrich
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #1 on: October 14, 2010, 10:59:37 AM »

SB+ doesn't have the ability to poll and refresh the screen on some interval, though it's something that's been requested over the years.  A similar type thing is possible however with some trial and error.  Here's the basics:

First, assume we're talking about a /PD.O output process/screen.  Also assume that the screen has a prompted key value.  The basic procedure would be to allow the user to enter the key value and then in some process on the screen (i.e. Proc After Read) put a delay* that - after the delay time - data stacks a <cr> for the bottom screen prompt and then data stacks the key into the screen again.  This will cause the output screen to loop endlessly.

The trick is stopping the loop.  Unidata and Universe each have a way (SYSTEM(14)?) that can check to see if any keys have been pressed.  If a key has been pressed, you terminate the delay and the data stacking so that the looping stops.

Note I didn't mention anything about the F7.  It's easier to have the screen reload itself from the key prompt (usually).  BUT you might try this:

On the process after on the last prompt on the (output) screen, put:

G:F7

This will set @RTN.FLAG = "F7" which will invoke the F7 function key.  In the F7 function key put your refresh logic, a delay, and then set @RTN.FLAG = "F7" at the end to kick off the F7 functionality again.  Be sure to incorporate some logic in the delay so that you can check when a key is pressed to stop the looping; otherwise the Break key may be the only way out.

YMMV; This usually takes some trial and error to get working right but the basic principle of the delay and data stacking should get you on the right road.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Thomas
Professional
***
Posts: 21


« Reply #2 on: October 14, 2010, 11:33:30 AM »

Thanks for the reply Kevin.

SB+ doesn't have the ability to poll and refresh the screen on some interval, though it's something that's been requested over the years.  A similar type thing is possible however with some trial and error.  Here's the basics:

First, assume we're talking about a /PD.O output process/screen. of the delay and data stacking should get you on the right road. ...
That is exactly what I have.  It is an output screen.  And T&E [trial & Error] is exactly what I've been doing.  However, I ended up mostly with the E part of that.  That is why I am asking you guys for some advise.

It looks like I will probably end up with a shell screen and have a program run in the background to continuously re-paint the output within the borders of the shell screen.
Logged

* Government is not the solution to our problem; government is the problem - Ronald Wilson Reagan
* Democrats are the party of food stamps and Republicans are the party of paychecks. - Newt Gingrich
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #3 on: October 14, 2010, 11:46:47 AM »

That's an interesting idea as well.  Let the screen do nothing more than display the values then wrap it up in some process that calculates the values, calls the screen, rinse, repeat.

...as long as you have some way for the screen to be stopped.  That's the only weird part.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!