Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-02-07T08:22:57Z by vazymimil
SystemAdmin
SystemAdmin
535 Posts
ACCEPTED ANSWER

Pinned topic getting the number of rows and columns in a window

‏2013-02-05T13:44:42Z |
Is there a way to get the number of rows and columns in a window inside an RPG program without hardcoding them?


* window frame A          R WINFRAME A                                      WINDOW(&WINLNE + A                                             &WINPOS + A                                             16 + A                                             76 + A                                             *NORSTCSR + A                                             *NOMSGLIN)


I want to programatically access (through INFDS, or some structure) the 16 and 76 in the above DDS example in my RPG program? I have looked at NUM_ROWS and NUM_COLS, but they don't give me what I want unless I am missing something... see below:


fsvp0203d  cf   e             workstn infds(Kbd) f                                     prefix(s_)   * representation of which key was pressed on the keyboard d Kbd             ds d  KeyPressed2          369    369 d  Misc                 241    566 d NUM_ROWS              282    283i 0                                      * Number of rows d NUM_COLS              284    285i 0                                      * Number of cols


NUM_ROWS and NUM_COLS return a large number like 1668, which I am not even sure how that is possible given their size, so maybe I am missing something somewhere...
Updated on 2013-02-07T08:22:57Z at 2013-02-07T08:22:57Z by vazymimil
  • vazymimil
    vazymimil
    8 Posts
    ACCEPTED ANSWER

    Re: getting the number of rows and columns in a window

    ‏2013-02-05T16:10:22Z  in response to SystemAdmin
    Num_rows and Num_cols are positionned at 382 and 383 and are each 1 byte long, this gives:

    
    * d NUM_ROWS              382    382i 0                                      * Number of rows d NUM_COLS              383    383i 0                                      * Number of cols
    


    but these do not contain the informations your looking for (16 76), they contain the last coordinates of the cursor.

    I don't think the size of the window is accessible through any structure but one in QDFRTVFD API.
    • SystemAdmin
      SystemAdmin
      535 Posts
      ACCEPTED ANSWER

      Re: getting the number of rows and columns in a window

      ‏2013-02-06T20:33:35Z  in response to vazymimil
      You wouldn't happen to have an example of how to access these values using QDFRTVFD would you?
      • vazymimil
        vazymimil
        8 Posts
        ACCEPTED ANSWER

        Re: getting the number of rows and columns in a window

        ‏2013-02-07T08:22:57Z  in response to SystemAdmin
        No I don't. Sorry.