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



Hi Gad

It is possible to avoid using  indicator with DSPATR(PC).
You could use CSRLOC at the record level, does not work with subfiles though.

The process I show uses DSPINFO service program to get the ROW/COL for your fields.
If you did not want to use DSPINFO you could just use a compile time array to define the ROW/COL info.

This is probably a bit much for you, but its an option.

Code is shown below.

It occurs to me that instead of using DSPATR(PC) with an indicator
.....AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions++++++
     A            FIELD1         4A    10 10
     A  15                                  DSPATR(PC)

You could use CSRLOC.
     A          R RECORD1                   CSRLOC(LINNBR POSNBR)
     A            LINNBR         3 0H
     A            POSNBR         3  0H


You need to bind DSPINFO service program to your program
       // CRTRPGMOD MODULE(urlib/urprogram)
       //             SRCFILE(urlib/ursrcfile)
       //             SRCMBR(urprogram) REPLACE(*YES)
       // CRTSRVPGM SRVPGM(urlib/DSPFINFO)
       //              MODULE(urlib/DSPFINFO)
       //                     EXPORT(*ALL)
       // CRTPGM PGM(urlib/urprogram) MODULE(urlib/urprogram)
       // BNDSRVPGM((urlib/DSPFINFO *IMMED) )


This is the code to set the cursor location to your field.

     D  $Lib           S             10
     D  $Fil           S             10

     D  $FilQul        S             20

     D #GotFlds        S             10I 0

     D RTVFLDS         PR              N
     D  $FilQul                      20    Value
     D  $NumFlds                     10I 0
     D  $FldDtaDS                          Like(FldDtaDS)


     D FldDtaDS        DS                  occurs(1000)
     D  #FmtNam                      10A
     D  #FldNam                      10A
     D  #FldLen                       5I 0
     D  #FldPlen                      5I 0
     D  #FldDec                       1
     D  #FldIO                        1
     D  #FldAtr                       1
     D  #FldDTUS                      1
     D  #FldEdt                      20A
     D  #FldRow                      10I 0
     D  #FldCol                      10I 0
     D  #FldCom                    1000A   varying


     //  One time only Load the Display File information data structure
          $FilQul = $Fil + $lib;   // your Display File and Library
          clear   FldDtaDs ;
          %occur(FlddtaDS) = 1;
          *IN10 = RTVFLDS ($FilQul : #GotFlds    : FldDtaDS);

you could make the following a procedure or subroutine.

     //  Set the Row Column to position the cursor
            for x = 1 to #Gotflds;
              %occur(FlddtaDS) = x;
             If #FmtNam = urFmt and #FldNam = 'FIELD1';
              LINNBR = #FldRow;
              POSNBR = #FldCol;
              leave;
             Endif;
           endfor;

Frank



On 22/08/2022 3:34 pm, Gad Miron wrote:
Hello Frank

Understood,

This is my 20-years-ago wishful thinking.

If I had the time and energy I could have written some utility to ingest a DDS source and add program-to-screen hidden fields
and use these fields  with DSPATR - the way you demonstrated.
I could also automatically generate a /COPY source with Hex values field for each of  the A/M hidden field
and then at last write the Field1.COLOR = 'RED'

But this is now just an idle intellectual exercise.

Thanks for your help
Gad

On Mon, Aug 22, 2022 at 7:56 AM Frank Kolmann <Frank.Kolmann@xxxxxxxxx <mailto:Frank.Kolmann@xxxxxxxxx>> wrote:

Hi Gad

The short answer is No.


The long answer, and I stand to be corrected is:-   (been a while)

The best you are going to get is Program-to-screen fields

FIELD1_ATR = x'28' ;  // Set colour to red


      A            FIELD1           10A  B  4 10DSPATR(&FIELD1_ATR)
      A            FIELD1_ATR     1A  P


I never noticed lower case field names are not allowed, how
archaic is
that eh?

Your qualified field names ie Field1.color , introduce new RPG
reserved
words,  ie .color  .BL  .PC  that wont happen IMO.
(5250 data streams are all pre OOP)

The 5250 data stream was designed for monochrome displays, it
still has
no Colour commands. afaik
Colours are the result of how colour hardware interprets the
monochrome
controls, IMO this wont change.

5250 Cursor control is not part of the attribute character, It is
contained in the FFW Field Format word, FFW is not directly
controllable
from DDS.


Frank





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.