× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: How to determine if device is 27x132?
  • From: dhandy@xxxxxxxxxxx (Douglas Handy)
  • Date: Thu, 10 Feb 2000 01:09:56 -0500

Jerry/Richard,

>> I'm working on a program that switches the display from 24x80 to 27x132 
>> depending on the view option that the user selects.
>          ... 
>> Other than retrieving the device characteristics of the user's terminal 
>> device, is there an easy way of determining if the user's terminal is a 
>> 27x132 device?

[snip]

>Here's one method using the file information data structure (in glorious
>RPG/400)...

[snip]

I think the question is whether or not the device is capable of
27x132, not what is the current screen mode.  What I do is use the
Dynamic Screen Manager API's, but these can only be used from an ILE
language like RPG IV.  

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
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.