Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Detecting Current Screen Size (*DS3/*DS4)

Posted on 2006-07-04
12
Medium Priority
?
999 Views
Last Modified: 2008-01-09
I need to be able to automatically detect the screen size (*DS3/*DS4) from within an RPG400 pgm in order that I can select the appropriate screen file for a pop-up warning in a window. The pop-up pgm is a general purpose security checker that is called by all user pgms.

I could add an input parameter but this would mean modifying hundreds of calling pgms. I really do need to be able to detect the screen size being used by the calling pgm so that the pop-up pgm will be the only one to require a change.
0
Comment
Question by:bodger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 17037348
Hi
you can use the file informational data structure

D NUM_ROWS                           282 283I 0 * Number of rows
D NUM_COLS                            284 285I 0 * Number of cols



Dave
0
 
LVL 13

Expert Comment

by:_b_h
ID: 17037389
Did you try conditioning the pop-up screen with indicators?

00010A                                      DSPSIZ(27 132 *LARGE 24 80 *NORMAL)
00020A          R RECORDA
00040A            FIELDB        10  0   1120
00050A  *NORMAL                         1 49

This snippet from IBM positions FIELDB depending on the display size.

Barry
0
 

Author Comment

by:bodger
ID: 17037664
Thanks Dave . I must test your solution before commenting further. It looks like RPGLE so I will have to write an external routine (in RPGLE) for the popup pgm, which is RPG400. I have yet to ascertain whether what is returned in the FIDS is the screen capability or the display size set by the calling program.


0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:bodger
ID: 17037720
Thanks to you too, Barry. However, the DSPSIZ keyword seems to select the screen size according to the capability of the device rather than the size set by the calling pgm. I need two display files, one *DS3 and the other *DS4 and need to be able to select the appropriate file so that the display of the calling program is not cleared before the popup window is displayed.
0
 

Author Comment

by:bodger
ID: 17038843
I get the feeling it would have to be passed as a parameter from the calling display pgm. Thanks for answering. I guess you could split the points between you but I don't know how to do that.
0
 
LVL 13

Expert Comment

by:_b_h
ID: 17039477
Take a look at the Retrieve Display Mode (QsnRtvMod) API which returns the current display mode.  Check out this link:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/apis/QsnRtvMod.htm


0
 
LVL 13

Accepted Solution

by:
_b_h earned 750 total points
ID: 17039658
Okay, I admit this one was driving me crazy. I tried out the API in a small pgm by calling it inside SEU. When I switch between 24x80 and 27x132, the value returned by the API changes as well, so it is returning the actual display size, not the capability of the device. Yeah!

Here is my test code:

PGM                                                                  
DCL   &DSPMODE     *CHAR    1                                        
DCL   &ENVHANDLE   *CHAR    4                                        
DCL   &ERRCODE     *CHAR    8                                        
             chgvar  &errcode   x'0000000000000000'                  
             chgvar  &envhandle x'00000000'                          
             CALLPRC  'QsnRtvMod' PARM(&DSPMODE &ENVHANDLE &ERRCODE)
             SNDPGMMSG &DSPMODE                                      
             RETURN                                                  
             ENDPGM                                  

Barry              
0
 

Author Comment

by:bodger
ID: 17039915
Thanks agains Barry but I don't seem to have any object called QSNRTVMOD anywhere on my system.
0
 
LVL 13

Expert Comment

by:_b_h
ID: 17040001
It should be there....the name is case sensitive....try copying and pasting the code above into a member of type CLLE  for a test. It works on our v4r3 system. If not, I'm sure we can figure it out.
0
 

Author Comment

by:bodger
ID: 17041547
Thanks Barry. I have to admit I didn't even know that CLLE existed; it's not mentioned in my V5R2 Info Center CD and I can find no meaningful reference in IBM's Boulder website . I will have to convert the CLLE pgm to a CMD so I can pass parameters in and then use QCMDEXC to call it from an RPG400 pgm. On the assumption that I will be able to do that, I will accept your solution.
0
 

Author Comment

by:bodger
ID: 17047429
Actually I have no need to convert to CMD, just to pass through the caller's parms to the target pgm, which will be selected according to the existing screen mode.

Thanks again.

Just out of interest, what and where exactly is QsnRtvMod? I gather that it is some kind of 'procedure' by virtue of the CALLPRC command. Where would I find a reference for such procs?
0
 
LVL 13

Expert Comment

by:_b_h
ID: 17049879
There are many Application programming interfaces (APIs). This particular one is made available as a procedure through service program QSNAPI. You can see it using:
DSPSRVPGM SRVPGM(QSNAPI) DETAIL(*PROCEXP)

To find more APIs, check the IBM Infocenter at:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp
and search for "API finder"

Barry
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

With the evolution of technology, we have finally reached a point where it is possible to have home automation features like having your thermostat turn up and door lock itself when you leave, as well as a complete home security system. This is a st…
An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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