Topic
  • 3 replies
  • Latest Post - ‏2013-02-07T08:22:57Z by vazymimil
SystemAdmin
SystemAdmin
535 Posts

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

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

    ‏2013-02-05T16:10:22Z  
    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

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

    ‏2013-02-06T20:33:35Z  
    • vazymimil
    • ‏2013-02-05T16:10:22Z
    Num_rows and Num_cols are positionned at 382 and 383 and are each 1 byte long, this gives:

    <pre class="jive-pre"> * d NUM_ROWS 382 382i 0 * Number of rows d NUM_COLS 383 383i 0 * Number of cols </pre>

    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.
    You wouldn't happen to have an example of how to access these values using QDFRTVFD would you?
  • vazymimil
    vazymimil
    8 Posts

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

    ‏2013-02-07T08:22:57Z  
    You wouldn't happen to have an example of how to access these values using QDFRTVFD would you?
    No I don't. Sorry.