× 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.



Hello,

> I have seen an example of this done by using an indicator array or indicator
> data structure that 'overlaid' a set of indicators, so that I could do
> something like
>      C                   Eval      MyInds = '000000000000'
> What D-spec would I need to create such a structure?


Here's some sample code from one of my own programs:

     D p_IndAra        s               *   inz(%addr(*in))
     D IndAra          ds                  based(p_IndAra)
     D  KEY_ALL                      26A   overlay(IndAra:01)
     D  KEY_HELP                      1N   overlay(IndAra:01)
     D  KEY_EDIT                      1N   overlay(IndAra:02)
     D  KEY_EXIT                      1N   overlay(IndAra:03)
     D  KEY_PROMPT                    1N   overlay(IndAra:04)
     D  KEY_REFRESH                   1N   overlay(IndAra:05)
     D  KEY_PRINT                     1N   overlay(IndAra:06)
     D  KEY_F7                        1N   overlay(IndAra:07)
     D  KEY_F8                        1N   overlay(IndAra:08)
     D  KEY_F9                        1N   overlay(IndAra:09)
     D  KEY_F10                       1N   overlay(IndAra:10)
     D  KEY_F11                       1N   overlay(IndAra:11)
     D  KEY_CANCEL                    1N   overlay(IndAra:12)
     D  KEY_F13                       1N   overlay(IndAra:13)
     D  KEY_F14                       1N   overlay(IndAra:14)
     D  KEY_F15                       1N   overlay(IndAra:15)
     D  KEY_F16                       1N   overlay(IndAra:16)
     D  KEY_F17                       1N   overlay(IndAra:17)
     D  KEY_F18                       1N   overlay(IndAra:18)
     D  KEY_F19                       1N   overlay(IndAra:19)
     D  KEY_F20                       1N   overlay(IndAra:20)
     D  KEY_F21                       1N   overlay(IndAra:21)
     D  KEY_F22                       1N   overlay(IndAra:22)
     D  KEY_F23                       1N   overlay(IndAra:23)
     D  KEY_F24                       1N   overlay(IndAra:24)
     D  KEY_PAGEUP                    1N   overlay(IndAra:25)
     D  KEY_PAGEDOWN                  1N   overlay(IndAra:26)

     D  SFL_ALL                       6A   overlay(IndAra:50)
     D  SFL_CLEAR                     1N   overlay(IndAra:50)
     D  SFL_IS_EMPTY                  1N   overlay(IndAra:51)
     D  SFL_DROP                      1N   overlay(IndAra:52)
     D  SFL_FOLD                      1N   overlay(IndAra:53)
     D  SFL_FULL                      1N   overlay(IndAra:54)
     D  SFL_NXTCHG                    1N   overlay(IndAra:55)


Then, for example, to reset all function keys:

     c                   eval      key_all = *OFF

Or to reset all subfile indicators:

     c                   eval      sfl_all = *OFF

To check if the user has pressed F3 to exit:

     c                   if        KEY_EXIT
     c                   eval      *INLR = *ON
     c                   return
     c                   endif

The way the code works is by overlaying the entire *IN array...  so, you
do have to make sure that the DDS is set up appropriately.  In this case,
indicator 03 must be set for F3 (with the CA03 or CF03 DDS keywords) and
the same for the other functions, for example I have the SFLCLR keyword
conditioned on indicator 50, and the SFLDSP keyword conditioned on
indicator 51...

Hope that helps

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.