Return to the RPG Tips
Determining *DS4 support -- 3 examples
Thanks Carel, Dan, Mark and Joep! I started on the QsnQry5250 api right after my post and, with your help, the combination answer I'm now using is below (for the archives). Joep, I like the way you think! D Qry5250 PR ExtProc('QsnQry5250') D p_Rcvr Like(DS_Rcvr) Const D p_RcvrLngth 10i 0 Const D p_Error Like(DS_APIError) Const D p_RtnCod 10i 0 Const * Qry5250 Reciever Data Structure D DS_Rcvr DS D d_BytesRtn 10i 0 D d_BytesAvl 10i 0 D d_QrySts 1a D d_WSCU 5i 0 D d_CodeLvl 3a D 16a D d_WSType 1a D d_MachType 4a D d_Model# 3a D d_KbdID 1a D d_xKbdID 1a D d_PCKbdID 1a D d_Serial# 4a D d_MaxInpFlds 5i 0 D d_WSCUC 2a D 1a D d_DevCap 12a D d_GridBuffers 1a D d_TypeGrid 1a D 1a D d_IorF 1a D d_IorFScale 1a D d_IorFRotate 1a D d_IorFSupport 1a D d_InvisibleTg 1a D 2a D w_RcvrLngth S 10i 0 inz(%len(ds_Rcvr)) D w_RtnCod S 10i 0 D i_DS4ok S Like(*in01) D w_1a S 1a C CallP Qry5250(DS_Rcvr : C w_RcvrLngth : C DS_APIError : C w_RtnCod ) C Eval w_1a = %subst(d_DevCap:2:1) C TestB '23' w_1a 01 C Eval i_DS4ok = *in01 Now if a CAE session is set for 24x80 *in01's *OFF and if it's set for 27x132 *in01's *ON. Now, maybe Barbara or Hans can explain why I end up with an indicator in the middle of my RPGIV code on v4r5???? ;-) Thanks again to list for your help! Tom Westdorp ================================================================================================================== ================================================================================================================== 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 =================================================================================================================== =================================================================================================================== * ////special notes to others that shall follow\\\\ * * /////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ * | **********VERY important information*********** | * | Number ONE: compile with OPTION 15 | * | Number TWO: run the following command after clean comp | * | | * | CRTPGM MWGRCLSCAN bndsrvpgm( dsplysiz) actgrp(QILE) | * | | * \\\\\\\\\\\\\\\\\\\\\\\\\\\\\///////////////////////////// HBndDir('MWSRCLIB/BOUND') D support127 s 1 D is_scrn_siz_ok... D s 1 *..................... D SupportDs3 PR N D DummyParm 1 Options( *Omit ) D SupportDs4 PR N D DummyParm 1 Options( *Omit ) C if is_scrn_siz_ok = '1' * Execute Screen One C EXSR SCRN1 C exsr closeoutbatch C else C exfmt notsmall ... endif *use a screen API to see what size it supports * 4=27x132 3=24x80 * return values 0=not valid 1=valid * Test for 80 Character support If SupportDs3( *Omit ) * This code is run when the display supports 80 characters eval is_scrn_siz_ok = '0' Else * This code is run when the display doesn't support 80 characters eval is_scrn_siz_ok = '0' EndIf * Test for 132 Character support If SupportDs4( *Omit ) * This code is run when the display supports 132 characters C eval is_scrn_siz_ok = '1' C Else * This code is run when the dsply doesn't support 132 characters C eval is_scrn_siz_ok = '0' C EndIf I forget where I got this from, it is similar to your solution, but mine has been working very well here...
[report a broken link by clicking here]