|
Hmmm, I thought I was using the QsnQryModSup API in one of my apps where I need to test for the same thing. Instead, I am using the INFDS to make the determination: d* WInfDS - Workstation INFormation Data Structure d WInfDS ds d Num_Rows 152 153B 0 d Num_Columns 154 155B 0 d* Num_******* - Returns the size capability of the display d* device; either 24x80 or 27x132 then, in the *INZSR: c If Num_Rows = 27 and Num_Columns = 132 c Eval DisplaySize = '27x132' c Eval #ofSflRcdsPage = #ofSflRcdsPg27 c Else c Eval DisplaySize = '24x80 ' c Eval #ofSflRcdsPage = #ofSflRcdsPg24 c EndIf then I test DisplaySize when I need to decide whether to display the 24x80 or the 27x132 version of the screen. c If DisplaySize = '27x132' c Write SflCtl27 c Else c Write SflCtl24 c EndIf I did a scan for QsnQryModSup on all of my source, and did turn up this source, which I wisely saved as a member named DET27X132 in my source file - the credit goes to Doug Handy: * There is one API which will return all sorts of information about the * device capabilities. The QsnQry5250 returns (among other things) a * 12-byte value with bits used for denoting all sorts of thing from size * to color to GUI characteristics, etc. But to just test if DS4 mode is * supported there is an even easier way. * * The DSM API to query mode support (QsnQryModSup) can be passed a mode * and it will return a flag indicating if that mode is valid on the * device. You pass a '3' to check if DS3 (24x80) is valid, and a '4' to * check if DS4 (27x132) is valid. * * I use a prototype like this, where ApiErrorDS is my standard error DS: * * D QryModSup PR 1 ExtProc( 'QsnQryModSup' ) * D DspMode 1 Const * D Handle 10I 0 Options( *NoPass ) * D ErrorDS Options( *NoPass ) * D Like( ApiErrorDS ) * * Note that the last two parameters are optional, and you can just * * C Eval Is27x132OK = QryModSup( '4' ) * * which will then have a true/false (1/0) status. I rename it to less * than 12 characters so I can use it on V3R2 systems. You do not need * to name a binding directory to use the DSM API's. * * Similarly, another API will tell you if the device supports color * (QsnQryColorSup), or you can check a bit returned by QsnQry5250. * Other bits tell you if you can use the Write Extended Attributes to * get up to 14 colors instead of just those available in DDS. * * Another useful API is QsnRtvMod which returns the current screen mode. * This is good in called programs which put up a window, and you want to * know if the underlying program is using 24x80 or 27x132 (regardless of * what the device is capable of). * * The DSM API's are way too underutilized. Many of them can be very * useful even if you only use DDS for all the screen formats. * * Doug < dhandy@isgroup.net > 2/10/2000 * * h DftActGrp( *No ) ActGrp( *New ) h debug Option( *SrcStmt : *NoDebugIO ) * d QryModSup PR 1 ExtProc( 'QsnQryModSup' ) d DspMode 1 Const d Handle 10I 0 Options( *NoPass ) d ErrorDS Options( *NoPass ) d Like( ApiErrorDS ) * **-- API Error Data Structure: -------------------------------- d ApiErrorDS DS d AeBytPro 10i 0 Inz( %Size( ApiErrorDS ) ) d AeBytAvl 10i 0 d AeExcpId 7a d 1a d AeExcpDta 256a * d Is27x132OK s n d Is24x80OK s n * c Eval Is27x132OK = QryModSup( '4' ) c Eval Is24x80OK = QryModSup( '3' ) c Dump c Eval *inLR = *On HTH, Dan Bale IT - AS/400 Handleman Company 248-362-4400 Ext. 4952 -------------------------- Original Message -------------------------- I'm trying to determine if a display session is capable of 27 x 132 (*DS4) support when I open a program so that I can determine which subfile I process (one that has 30 characters of a longer string or one that has 60 characters). I'm using the QsnQryModSup API in the QSNAPI service program and asking for display mode 4 and indicator 1 and I always get 0 as the return value mode indication (from CAE using either 27 x 132 or 24 x 80 configurations). D QryDspMode PR ExtProc('QsnQryModSup') D p_DspMode 1a Const D p_ModeInd 1a Const D p_LowLvlHdl 10i 0 Const D p_Error Like(DS_APIError) Const D p_RtnInd 10i 0 D w_DspMode S 1a inz('4') D w_ModeInd S 1a inz('0') D w_LowLvlHdl S 10i 0 inz(0) D w_Error S Like(DS_APIError) D w_RtnInd S 10i 0 C CallP QryDspMode(w_DspMode : C w_ModeInd : C w_LowLvlHdl : C DS_APIError : C w_RtnInd ) Any ideas? Or alternatives? I don't want to just relocate fields based on the display size, I want to display a larger subset of a database field. TIA Tom Westdorp AS/400 Senior Programmer/Analyst IBM Certified Specialist - RPG IV Programmer IBM Certified Specialist - RPG IV Developer Certified Master RPG IV Programmer Internal Telephone # 04-6859 Voice: (702) 221-6859 Fax: (702) 221-6881 tom.westdorp@stationcasinos.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.