home   about us   contact us  
Distribtution
Financial
Appx
News
Search site for:




To 'GUI' or Not to 'GUI'

If you have a mixed environment, with some users connecting with terminal emulation, and some with a GUI interface, it might be handy to be able to tell which interface is currently being used. Here are two techniques:

    * Are we character or are we GUI (Presentation Manager)?
    * A presentation manager session has '-f=' on its
    * command line (as viewed with 'ps -ef'). We can check for this
    * and if it's there, it means this session is using P/M or JAVA
    * client. If not, we are a normal character based session.
    SET     --- TEMP 80 = -f
    SET     --- LI = 80
    PASS    --- TEMP 80 FIELD SHARE? Y
    PASS    --- LI      FIELD SHARE? Y
    CALL    ,RT_GETPARAM RESIDENT? Y END? N FAIL 0
    * if TEMP 80 still contains '-f', then we are *not* P/M
    * if it contains anything else (usually 4, don't know why) then we
    * are GUI P/M or JAVA
    IF --- TEMP 80 EQ -f
T   SET --- TEMP 1 = C
F   SET --- TEMP 1 = G
The above technique also demonstrates the use of RT_GETPARAM to check for arguments on the command line. TEMP 80 contains the parameter we are interested in ('-f' in this case). After calling RT_GETPARAM, TEMP 80 will either contain the data on the right hand side of '-f=', or it will still contain '-f' if '-f' is not found on the command line. This approach does not distinguish between the Java Client and the Presentation Manager client.

Another approach is:

    PASS --- FEATURE TOKEN SCANLIST FIELD SHARE? Y
    CALL ,RT_CHECK_CLI_FEATURE RESIDENT? N END? N FAIL 0
    IF --- RETURN CODE EQ +1
T   It's the Java Client
F   It's not
This technique specifically tests for the Java client, and will return +0 if the user is character or Presentation Manager.

Testing for Numeric

Occasionally, we have to allow the user to enter data into an alpha field but we still need to verify that the field only contains numbers. One approach is to examine each byte of the field and checking to ensure that it's between 0 and 9. However, in release 4.2.4 and higher, there's a much better way of doing this check. When using the CNV TEXT to move an alpha to a numeric, APPX will set the T/F flag to F if the sending field is not numeric:

    CNV TEXT --- XI = --- TEMP 132 
F   <field is not numeric>


Text under Toolbar Icons

You can enable text and icons in the APPX toolbar. First, in the Client Preferences, [Options], set toolbarStyle=both. Then, in the GUI Attributes for Optional Children, append '@SST=<some text>' to the end of the label. If the Optional Child appears on the toolbar, the 'some text' will appear underneath the icon. Eventually there will be a better way of specifying this, but at the moment you can use this technique. For an example of this, enable the client preference, and go into Application Design.


Do you have a tip you want to pass on? Contact Us.


« Return



© Copyright 2009 - C.A.N.S.Y.S. West Limited All Rights Reserved