• Problem with SysTextScreenSize()

    From Jack@21:1/5 to All on Mon Nov 13 16:16:05 2017
    When trying to obtain a screen size for a text window in Win 10, I use this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down. The "window size" is also in the windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size. The buffer is the
    length of a string before it is wrapped to the next line. I want the
    window size so I can center text, menus and so on. I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140 and height of 30,
    which is the actual numbers needed to center text and menus, and those
    numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large, but
    the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to Jack on Mon Nov 13 17:30:05 2017
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window properties layout drop down.  The "window size" is also in the windows layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the
    window size so I can center text, menus and so on.  I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of 30, which is the actual numbers needed to  center text and menus, and those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large, but
    the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to LesK on Tue Nov 14 22:04:30 2017
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down. The "window size" is also in the windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size. The buffer is the
    length of a string before it is wrapped to the next line. I want the
    window size so I can center text, menus and so on. I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140 and height of
    30, which is the actual numbers needed to center text and menus, and
    those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows, and
    right click on the title bar at the top of the window and select
    properties, you can set the properties of the window. The properties
    window has 4 tabs: Options, Font, Layout and Color. The Layout option
    has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open your
    script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col. What I want is the
    Window Size Width and Height for row and col. The buffer size is pretty
    much useless far as Rexx programs are concerned, as the buffer is not
    related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to know
    the Window Size: width of the screen, NOT the Screen Buffer Size: Width
    of the screen. So, if you center say a menu on your screen, then later
    change the size of the screen the menu will no longer be centered. If
    you could obtain the actual screen size instead of the buffer size with SystextScreenSize() your scrips could always correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some other
    way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a Windows
    only ooRexx function.


    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to Jack on Tue Nov 14 23:51:01 2017
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down.  The "window size" is also in the windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the
    window size so I can center text, menus and so on.  I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of
    30, which is the actual numbers needed to  center text and menus, and
    those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows, and
    right click on the title bar at the top of the window and select
    properties, you can set the properties of the window.  The properties
    window has 4 tabs: Options, Font, Layout and Color.  The Layout option
    has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open your script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col.  What I want is the Window Size Width and Height for row and col.  The buffer size is pretty much useless far as Rexx programs are concerned, as the buffer is not
    related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to know
    the Window Size: width of the screen, NOT the Screen Buffer Size: Width
    of the screen.  So, if you center say a menu on your screen, then later change the size of the screen the menu will no longer be centered.  If
    you could obtain the actual screen size instead of the buffer size with SystextScreenSize() your scrips could always correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some other
    way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a Windows
    only ooRexx function.


    You've explained the problem nicely, but what *application* are you
    going to use to write to the screen such that you have to
    programmatically determine the height and width of the screen in characters?

    Obviously, programs like oodialog and others can make that
    determination, but there may not be a Windows API that ooRexx can
    present to the programmer.

    Maybe someone like Rony can help. I'm rather new at details of the pc.
    I mostly use The Hessling Editor to do my work, with ooRexx as the
    interpreter but using mostly Classic Rexx.


    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rony@21:1/5 to LesK on Wed Nov 15 15:05:57 2017
    On 15.11.2017 05:51, LesK wrote:
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use >>>> this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down.  The "window size" is also in the windows >>>> layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the >>>> window size so I can center text, menus and so on.  I want the buffer >>>> size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of
    30, which is the actual numbers needed to  center text and menus, and >>>> those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows, and right click on the title
    bar at the top of the window and select properties, you can set the properties of the window.  The
    properties window has 4 tabs: Options, Font, Layout and Color.  The Layout option has settings for
    Screen Buffer Size: Width and height; Window Size: width and height and Window Postion: left and
    top. These setting when set with your script open will remain the same every time you open your
    script.

    When you run the ooRexx function SysTextScreenSize() it returns the Screen Buffer Size Width and
    Height for row and col.  What I want is the Window Size Width and Height for row and col.  The
    buffer size is pretty much useless far as Rexx programs are concerned, as the buffer is not
    related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to know the Window Size: width of
    the screen, NOT the Screen Buffer Size: Width of the screen.  So, if you center say a menu on your
    screen, then later change the size of the screen the menu will no longer be centered.  If you
    could obtain the actual screen size instead of the buffer size with SystextScreenSize() your
    scrips could always correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some other way to get the window size
    in rexx?

    If by "drive the Screen" you mean what command processor I use, I use the standard Win 10 command
    shell. The SysTextScreenSize() is a Windows only ooRexx function.


    You've explained the  problem nicely, but what *application* are you going to use to write to the
    screen such that you have to programmatically determine the height and width of the screen in
    characters?

    Obviously, programs like oodialog and others can make that determination, but there may not be a
    Windows API that ooRexx can present to the programmer.

    Maybe someone like Rony can help. I'm rather new at  details of the pc.
    I mostly use  The Hessling Editor to do my work, with ooRexx as the interpreter but  using mostly
    Classic Rexx.

    Well, researching the current possibilities I found <https://superuser.com/questions/584027/can-you-dynamically-resize-windows-command-line-window>
    which points to this utility <https://sourceforge.net/projects/console/?source=navbar>, which might
    help for your problem (just in case to set the screen buffer see "mode /?").

    If BSF4ooRexx (ooRexx to Java bridge camouflaging Java as ooRexx) is an option then you might want
    to use <https://sourceforge.net/projects/javacurses/> for your needs.

    ---rony

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to LesK on Wed Nov 15 10:06:02 2017
    On 11/14/2017 11:51 PM, LesK wrote:
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use >>>> this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down. The "window size" is also in the windows >>>> layout properties window, but this value is ignored.

    The buffer size is not the same as window size. The buffer is the
    length of a string before it is wrapped to the next line. I want the
    window size so I can center text, menus and so on. I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140 and height of
    30, which is the actual numbers needed to center text and menus, and
    those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows,
    and right click on the title bar at the top of the window and select
    properties, you can set the properties of the window. The properties
    window has 4 tabs: Options, Font, Layout and Color. The Layout option
    has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open
    your script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col. What I want is
    the Window Size Width and Height for row and col. The buffer size is
    pretty much useless far as Rexx programs are concerned, as the buffer
    is not related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to
    know the Window Size: width of the screen, NOT the Screen Buffer Size:
    Width of the screen. So, if you center say a menu on your screen,
    then later change the size of the screen the menu will no longer be
    centered. If you could obtain the actual screen size instead of the
    buffer size with SystextScreenSize() your scrips could always
    correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some
    other way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a
    Windows only ooRexx function.


    You've explained the problem nicely, but what *application* are you
    going to use to write to the screen such that you have to
    programmatically determine the height and width of the screen in
    characters?

    I'm using programs I wrote with ooRexx. When I run Rexx program,
    Windows opens a shell to run the Rexx script. As I explained above,
    Windows sets the properties of the window for that program based on some default at first, then, if you change any of those properties, like
    screen color, buffer width and height, SCREEN SIZE width an height, the
    next time you run that script, windows will open it with those new
    properties.

    The one property that I need in Rexx scripts is the screen column size,
    which is needed to center text, particularly in the SysCurPos(row,col) function.

    Unfortunately, you cannot (to my knowledge) set these properties from
    within the Rexx scripts, and you can only read one property, which unfortunately happens to be the one you don't really need, the buffer
    size. What is needed is the Screen Size, and mainly the width, because
    it is used to center text on the screen.

    Obviously, programs like oodialog and others can make that
    determination, but there may not be a Windows API that ooRexx can
    present to the programmer.

    I'm not familiar with 00dialog, but looking at the Rexx docs for it, it
    seems to have (had) a ScreenSize() function which I understood but it
    didn't work for me as described in the docs. (Error 43.1: Could not
    find routine "SCREENSIZE")

    More reading shows it was deprecated and replaced with 10.2.7.
    getSystemMetrics (Class Method).

    This Class stuff is way over my head, (I'm an old man, and have
    developed massive mental block for any thing objective, which I call
    obfuscated code) so I have no idea what that is all about. If anyone
    can explain how to include this code in my Rexx scripts to get the
    actual screen size so I can center text I would be grateful.

    Maybe someone like Rony can help. I'm rather new at details of the pc.
    I mostly use The Hessling Editor to do my work, with ooRexx as the interpreter but using mostly Classic Rexx.

    I'm not a programer, but programing has been a major hobby of mine since
    around 1983. I taught my self many languages, including C (but not
    C++). I mainly used (past tense) high level stuff like AWK, Gawk, Sed,
    Borne, DOS and 4DOS shells and so on. I learned classic REXX with OS/2
    and it is by far my favorite. When OS/2 was killed, I went to Windows
    and THANK GOD ooRexx was created, it seems just for me. It's a simple,
    yet powerful enough language if you stay away from the Object Oriented
    stuff, which I could never seem to learn (tried several times, and failed)

    Anyhow, I'm not sure who Rony is, but if he can help an old man out,
    that would be great. If he has anything to do with writing code for Rexx
    5.0, I wish he would look into this SysTextScreenSize() function and see
    if it couldn't return the screen size rather than the seemingly much
    less useful screen buffer size...

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to Jack on Wed Nov 15 13:19:58 2017
    On 11/15/2017 10:06 AM, Jack wrote:
    On 11/14/2017 11:51 PM, LesK wrote:
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use >>>>> this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window >>>>> properties layout drop down.  The "window size" is also in the windows >>>>> layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the >>>>> window size so I can center text, menus and so on.  I want the buffer >>>>> size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of >>>>> 30, which is the actual numbers needed to  center text and menus, and >>>>> those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows,
    and right click on the title bar at the top of the window and select
    properties, you can set the properties of the window.  The properties
    window has 4 tabs: Options, Font, Layout and Color.  The Layout option
    has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open
    your script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col.  What I want is
    the Window Size Width and Height for row and col.  The buffer size is
    pretty much useless far as Rexx programs are concerned, as the buffer
    is not related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to
    know the Window Size: width of the screen, NOT the Screen Buffer Size:
    Width of the screen.  So, if you center say a menu on your screen,
    then later change the size of the screen the menu will no longer be
    centered.  If you could obtain the actual screen size instead of the
    buffer size with SystextScreenSize() your scrips could always
    correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some
    other way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a
    Windows only ooRexx function.


    You've explained the  problem nicely, but what *application* are you
    going to use to write to the screen such that you have to
    programmatically determine the height and width of the screen in
    characters?

    I'm using programs I wrote with ooRexx.  When I run Rexx program,
    Windows opens a shell to run the Rexx script.  As I explained above,
    Windows sets the properties of the window for that program based on some default at first, then, if you change any of those properties, like
    screen color, buffer width and height, SCREEN SIZE width an height, the
    next time you run that script, windows will open it with those new properties.

    The one property that I need in Rexx scripts is the screen column size,
    which is needed to center text, particularly in the SysCurPos(row,col) function.

    Unfortunately, you cannot (to my knowledge) set these properties from
    within the Rexx scripts, and you can only read one property, which unfortunately happens to be the one you don't really need, the buffer
    size.  What is needed is the Screen Size, and mainly the width, because
    it is used to center text on the screen.

    Obviously, programs like oodialog and others can make that
    determination, but there may not be a Windows API that ooRexx can
    present to the programmer.

    I'm not familiar with 00dialog, but looking at the Rexx docs for it, it
    seems to have (had) a ScreenSize() function which I understood but it
    didn't work for me as described in the docs.  (Error 43.1:  Could not
    find routine "SCREENSIZE")

    More reading shows it was deprecated and replaced with 10.2.7. getSystemMetrics (Class Method).

    This Class stuff is way over my  head, (I'm an old man, and have
    developed massive mental block for any thing objective, which I call obfuscated code) so I have no idea what that is all about.  If anyone
    can explain how to include this code in my Rexx scripts to get the
    actual screen size so I can center text I would be grateful.

    Maybe someone like Rony can help. I'm rather new at  details of the pc.
    I mostly use  The Hessling Editor to do my work, with ooRexx as the
    interpreter but  using mostly Classic Rexx.

    I'm not a programer, but programing has been a major hobby of mine since around 1983.  I taught my self many languages, including C (but not
    C++).  I mainly used (past tense) high level stuff like AWK, Gawk, Sed, Borne, DOS and 4DOS shells and so on.  I learned classic REXX with OS/2
    and it is by far my favorite.  When OS/2 was killed, I went to Windows
    and THANK GOD ooRexx was created, it seems just for me.  It's a simple,
    yet powerful enough language if you stay away from the Object Oriented
    stuff, which I could never seem to learn (tried several times, and failed)

    Anyhow, I'm not sure who Rony is, but if he can help an old man out,
    that would be great. If he has anything to do with writing code for Rexx
    5.0, I wish he would look into this SysTextScreenSize() function and see
    if it couldn't return the screen size rather than the seemingly much
    less useful screen buffer size...

    The Change list for 5.0.0 Beta shows an entry for this, but I can't get Sourceforge to show it to me.

    You could try 5.0.0 Beta. If you don't have a 2nd pc to test it on,
    send me a direct email and ask for ORXVER, the latest incantation of
    CHGREX as presented at a recent Rexx Language Symposium.
    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rony@21:1/5 to Jack on Wed Nov 15 19:09:46 2017
    On 15.11.2017 16:06, Jack wrote:
    On 11/14/2017 11:51 PM, LesK wrote:
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use >>>>> this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window >>>>> properties layout drop down.  The "window size" is also in the windows >>>>> layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the >>>>> window size so I can center text, menus and so on.  I want the buffer >>>>> size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of >>>>> 30, which is the actual numbers needed to  center text and menus, and >>>>> those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows,
    and right click on the title bar at the top of the window and select
    properties, you can set the properties of the window.  The properties
    window has 4 tabs: Options, Font, Layout and Color.  The Layout option
    has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open
    your script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col.  What I want is
    the Window Size Width and Height for row and col.  The buffer size is
    pretty much useless far as Rexx programs are concerned, as the buffer
    is not related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to
    know the Window Size: width of the screen, NOT the Screen Buffer Size:
    Width of the screen.  So, if you center say a menu on your screen,
    then later change the size of the screen the menu will no longer be
    centered.  If you could obtain the actual screen size instead of the
    buffer size with SystextScreenSize() your scrips could always
    correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some
    other way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a
    Windows only ooRexx function.


    You've explained the  problem nicely, but what *application* are you
    going to use to write to the screen such that you have to
    programmatically determine the height and width of the screen in
    characters?

    I'm using programs I wrote with ooRexx.  When I run Rexx program, Windows opens a shell to run the
    Rexx script.  As I explained above, Windows sets the properties of the window for that program based
    on some default at first, then, if you change any of those properties, like screen color, buffer
    width and height, SCREEN SIZE width an height, the next time you run that script, windows will open
    it with those new properties.

    The one property that I need in Rexx scripts is the screen column size, which is needed to center
    text, particularly in the SysCurPos(row,col) function.

    Unfortunately, you cannot (to my knowledge) set these properties from within the Rexx scripts, and
    you can only read one property, which unfortunately happens to be the one you don't really need, the
    buffer size.  What is needed is the Screen Size, and mainly the width, because it is used to center
    text on the screen.

    Obviously, programs like oodialog and others can make that
    determination, but there may not be a Windows API that ooRexx can
    present to the programmer.

    I'm not familiar with 00dialog, but looking at the Rexx docs for it, it seems to have (had) a
    ScreenSize() function which I understood but it didn't work for me as described in the docs.  (Error
    43.1:  Could not find routine "SCREENSIZE")

    More reading shows it was deprecated and replaced with 10.2.7. getSystemMetrics (Class Method).

    This Class stuff is way over my  head, (I'm an old man, and have developed massive mental block for
    any thing objective, which I call obfuscated code) so I have no idea what that is all about.  If
    anyone can explain how to include this code in my Rexx scripts to get the actual screen size so I
    can center text I would be grateful.

    Maybe someone like Rony can help. I'm rather new at  details of the pc.
    I mostly use  The Hessling Editor to do my work, with ooRexx as the
    interpreter but  using mostly Classic Rexx.

    I'm not a programer, but programing has been a major hobby of mine since around 1983.  I taught my
    self many languages, including C (but not C++).  I mainly used (past tense) high level stuff like
    AWK, Gawk, Sed, Borne, DOS and 4DOS shells and so on.  I learned classic REXX with OS/2 and it is by
    far my favorite.  When OS/2 was killed, I went to Windows and THANK GOD ooRexx was created, it seems
    just for me.  It's a simple, yet powerful enough language if you stay away from the Object Oriented
    stuff, which I could never seem to learn (tried several times, and failed)

    Anyhow, I'm not sure who Rony is, but if he can help an old man out, that would be great. If he has
    anything to do with writing code for Rexx 5.0, I wish he would look into this SysTextScreenSize()
    function and see if it couldn't return the screen size rather than the seemingly much less useful
    screen buffer size...


    Well the function returns what "mode" returns (just enter "mode /?" on the command line to learn its
    usage).

    If you control the application and want to control the screen size, then one thing you could do is
    to set the screen size yourself at the beginning of your Rexx program with the "mode" command, e.g.


    "mode con cols=80 lines=25"
    say SysTextScreenSize() /* will return "25 80" */
    ... your code goes here ...

    If the current window is larger or smaller or has scroll bars active, then the mode command will
    maximize the window if it would fit on the screen (and reset the column and line buffers to the
    sizes given in the mode command). As a result your program will be able to rely on these sizes.

    HTH,

    ---rony

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to LesK on Wed Nov 15 18:24:25 2017
    On 11/15/2017 1:19 PM, LesK wrote:
    On 11/15/2017 10:06 AM, Jack wrote:
    On 11/14/2017 11:51 PM, LesK wrote:
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I >>>>>> use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window >>>>>> properties layout drop down.  The "window size" is also in the
    windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the >>>>>> length of a string before it is wrapped to the next line.  I want >>>>>> the
    window size so I can center text, menus and so on.  I want the
    buffer
    size to be large, while the actual window size some fraction of my >>>>>> actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of >>>>>> 30, which is the actual numbers needed to  center text and menus, >>>>>> and
    those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large, >>>>>> but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows,
    and right click on the title bar at the top of the window and select
    properties, you can set the properties of the window.  The properties >>>> window has 4 tabs: Options, Font, Layout and Color.  The Layout option >>>> has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open
    your script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col.  What I want is >>>> the Window Size Width and Height for row and col.  The buffer size is >>>> pretty much useless far as Rexx programs are concerned, as the buffer
    is not related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to
    know the Window Size: width of the screen, NOT the Screen Buffer Size: >>>> Width of the screen.  So, if you center say a menu on your screen,
    then later change the size of the screen the menu will no longer be
    centered.  If you could obtain the actual screen size instead of the >>>> buffer size with SystextScreenSize() your scrips could always
    correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some
    other way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a
    Windows only ooRexx function.


    You've explained the  problem nicely, but what *application* are you
    going to use to write to the screen such that you have to
    programmatically determine the height and width of the screen in
    characters?

    I'm using programs I wrote with ooRexx.  When I run Rexx program,
    Windows opens a shell to run the Rexx script.  As I explained above,
    Windows sets the properties of the window for that program based on
    some default at first, then, if you change any of those properties,
    like screen color, buffer width and height, SCREEN SIZE width an
    height, the next time you run that script, windows will open it with
    those new properties.

    The one property that I need in Rexx scripts is the screen column
    size, which is needed to center text, particularly in the
    SysCurPos(row,col) function.

    Unfortunately, you cannot (to my knowledge) set these properties from
    within the Rexx scripts, and you can only read one property, which
    unfortunately happens to be the one you don't really need, the buffer
    size.  What is needed is the Screen Size, and mainly the width,
    because it is used to center text on the screen.

    Obviously, programs like oodialog and others can make that
    determination, but there may not be a Windows API that ooRexx can
    present to the programmer.

    I'm not familiar with 00dialog, but looking at the Rexx docs for it,
    it seems to have (had) a ScreenSize() function which I understood but
    it didn't work for me as described in the docs.  (Error 43.1:  Could >> not find routine "SCREENSIZE")

    More reading shows it was deprecated and replaced with 10.2.7.
    getSystemMetrics (Class Method).

    This Class stuff is way over my  head, (I'm an old man, and have
    developed massive mental block for any thing objective, which I call
    obfuscated code) so I have no idea what that is all about.  If anyone
    can explain how to include this code in my Rexx scripts to get the
    actual screen size so I can center text I would be grateful.

    Maybe someone like Rony can help. I'm rather new at  details of the pc. >>> I mostly use  The Hessling Editor to do my work, with ooRexx as the
    interpreter but  using mostly Classic Rexx.

    I'm not a programer, but programing has been a major hobby of mine
    since around 1983.  I taught my self many languages, including C (but
    not C++).  I mainly used (past tense) high level stuff like AWK,
    Gawk, Sed, Borne, DOS and 4DOS shells and so on.  I learned classic
    REXX with OS/2 and it is by far my favorite.  When OS/2 was killed, I
    went to Windows and THANK GOD ooRexx was created, it seems just for
    me.  It's a simple, yet powerful enough language if you stay away
    from the Object Oriented stuff, which I could never seem to learn
    (tried several times, and failed)

    Anyhow, I'm not sure who Rony is, but if he can help an old man out,
    that would be great. If he has anything to do with writing code for
    Rexx 5.0, I wish he would look into this SysTextScreenSize() function
    and see if it couldn't return the screen size rather than the
    seemingly much less useful screen buffer size...

    The Change list for 5.0.0 Beta shows an entry for this, but I can't get Sourceforge to show it to me.

    You could try 5.0.0 Beta. If you don't have a 2nd pc to test  it on,
    send me a direct email and ask for ORXVER, the latest  incantation of
    CHGREX as presented at a recent Rexx Language Symposium.

    OOPS! It was a DOC bug that was closed :-( I'll try to get it set to an
    RFE, or do it myself. That will not guarantee that it will get added,
    but at least the request will be recorded.

    BTW: You could get a SourceForge userid (free and anonymous if you want)
    and participate directly with the folks that develop and fix ooRexx.
    Start at oorexx.org and there is a link to SF right after the logo.

    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mberg@21:1/5 to All on Wed Nov 15 23:56:54 2017
    Am Montag, 13. November 2017 22:16:12 UTC+1 schrieb Jack:

    What about
    physicalScreenSize = .DlgUtil~screenSize('PIXELS')
    say physicalScreenSize~height
    say physicalScreenSize~width

    I use that in a method to get information about the task bar

    /*--------------------------------------------------------------------*/
    /* Method returns position of Windows TaskBar */
    /* top, bottom, left or right */
    /* and the amount of pixels that reduces the physical screen */ /*--------------------------------------------------------------------*/ ::Method taskBarPosition; /*--------------------------------------------------------------------*/
    /* Get the working Area, this is the useable screen and information */
    /* where it is on the physical screen */ /*--------------------------------------------------------------------*/
    workingAreaCornerPoints = .DlgUtil~screenArea()
    workingAreaSize = .DlgUtil~screenSize('P')
    if workingAreaCornerPoints~left <> 0 Then return "left" workingAreaCornerPoints~left;
    if workingAreaCornerPoints~top <> 0 Then return "top" workingAreaCornerPoints~top;
    /*--------------------------------------------------------------------*/
    /* get the screen size in Pixels, this is the physical screen */ /*--------------------------------------------------------------------*/
    physicalScreenSize = .DlgUtil~screenSize('PIXELS')
    if workingAreaCornerPoints~bottom <> physicalScreenSize~height Then ,
    return "bottom" physicalScreenSize~height - workingAreaCornerPoints~bottom;
    else ,
    return "right" physicalScreenSize~width - workingAreaCornerPoints~right; Return

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to Rony on Thu Nov 16 09:05:52 2017
    On 11/15/2017 1:09 PM, Rony wrote:
    On 15.11.2017 16:06, Jack wrote:
    On 11/14/2017 11:51 PM, LesK wrote:
    On 11/14/2017 10:04 PM, Jack wrote:
    On 11/13/2017 5:30 PM, LesK wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use >>>>>> this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window >>>>>> properties layout drop down.  The "window size" is also in the windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the >>>>>> length of a string before it is wrapped to the next line.  I want the >>>>>> window size so I can center text, menus and so on.  I want the buffer >>>>>> size to be large, while the actual window size some fraction of my >>>>>> actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of >>>>>> 30, which is the actual numbers needed to  center text and menus, and >>>>>> those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large, >>>>>> but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    What will you be using to drive the screen?

    Not sure what you mean by drive the screen?

    When you open a command prompt, or run your Rexx script in windows,
    and right click on the title bar at the top of the window and select
    properties, you can set the properties of the window.  The properties >>>> window has 4 tabs: Options, Font, Layout and Color.  The Layout option >>>> has settings for Screen Buffer Size: Width and height; Window Size:
    width and height and Window Postion: left and top. These setting when
    set with your script open will remain the same every time you open
    your script.

    When you run the ooRexx function SysTextScreenSize() it returns the
    Screen Buffer Size Width and Height for row and col.  What I want is >>>> the Window Size Width and Height for row and col.  The buffer size is >>>> pretty much useless far as Rexx programs are concerned, as the buffer
    is not related to the actual window size you are looking at.

    For example, if you center text with SysCurPos(row col) you need to
    know the Window Size: width of the screen, NOT the Screen Buffer Size: >>>> Width of the screen.  So, if you center say a menu on your screen,
    then later change the size of the screen the menu will no longer be
    centered.  If you could obtain the actual screen size instead of the >>>> buffer size with SystextScreenSize() your scrips could always
    correctly center text.

    I suspect this is a mistake in REXX for windows, or there is some
    other way to get the window size in rexx?

    If by "drive the Screen" you mean what command processor I use, I use
    the standard Win 10 command shell. The SysTextScreenSize() is a
    Windows only ooRexx function.


    You've explained the  problem nicely, but what *application* are you
    going to use to write to the screen such that you have to
    programmatically determine the height and width of the screen in
    characters?

    I'm using programs I wrote with ooRexx.  When I run Rexx program, Windows opens a shell to run the
    Rexx script.  As I explained above, Windows sets the properties of the window for that program based
    on some default at first, then, if you change any of those properties, like screen color, buffer
    width and height, SCREEN SIZE width an height, the next time you run that script, windows will open
    it with those new properties.

    The one property that I need in Rexx scripts is the screen column size, which is needed to center
    text, particularly in the SysCurPos(row,col) function.

    Unfortunately, you cannot (to my knowledge) set these properties from within the Rexx scripts, and
    you can only read one property, which unfortunately happens to be the one you don't really need, the
    buffer size.  What is needed is the Screen Size, and mainly the width, because it is used to center
    text on the screen.

    Obviously, programs like oodialog and others can make that
    determination, but there may not be a Windows API that ooRexx can
    present to the programmer.

    I'm not familiar with 00dialog, but looking at the Rexx docs for it, it seems to have (had) a
    ScreenSize() function which I understood but it didn't work for me as described in the docs.  (Error
    43.1:  Could not find routine "SCREENSIZE")

    More reading shows it was deprecated and replaced with 10.2.7. getSystemMetrics (Class Method).

    This Class stuff is way over my  head, (I'm an old man, and have developed massive mental block for
    any thing objective, which I call obfuscated code) so I have no idea what that is all about.  If
    anyone can explain how to include this code in my Rexx scripts to get the actual screen size so I
    can center text I would be grateful.

    Maybe someone like Rony can help. I'm rather new at  details of the pc. >>> I mostly use  The Hessling Editor to do my work, with ooRexx as the
    interpreter but  using mostly Classic Rexx.

    I'm not a programer, but programing has been a major hobby of mine since around 1983.  I taught my
    self many languages, including C (but not C++).  I mainly used (past tense) high level stuff like
    AWK, Gawk, Sed, Borne, DOS and 4DOS shells and so on.  I learned classic REXX with OS/2 and it is by
    far my favorite.  When OS/2 was killed, I went to Windows and THANK GOD ooRexx was created, it seems
    just for me.  It's a simple, yet powerful enough language if you stay away from the Object Oriented
    stuff, which I could never seem to learn (tried several times, and failed) >>
    Anyhow, I'm not sure who Rony is, but if he can help an old man out, that would be great. If he has
    anything to do with writing code for Rexx 5.0, I wish he would look into this SysTextScreenSize()
    function and see if it couldn't return the screen size rather than the seemingly much less useful
    screen buffer size...


    Well the function returns what "mode" returns (just enter "mode /?" on the command line to learn its
    usage).

    If you control the application and want to control the screen size, then one thing you could do is
    to set the screen size yourself at the beginning of your Rexx program with the "mode" command, e.g.


    "mode con cols=80 lines=25"
    say SysTextScreenSize() /* will return "25 80" */
    ... your code goes here ...

    If the current window is larger or smaller or has scroll bars active, then the mode command will
    maximize the window if it would fit on the screen (and reset the column and line buffers to the
    sizes given in the mode command). As a result your program will be able to rely on these sizes.

    HTH,

    ---rony

    Rony: That doesn't Meet Requirements. As Jack explained,
    SysTextScreenSize() does NOT return the screen size, it returns the
    BUFFER size and he wants his buffer to be a lot larger than the screen
    so it can hold more historical data.

    I do the same thing when I'm debugging raw oorexx code that I can't
    replicate with THE, since it can usually capture the whole console
    trace and present it to me as just another file in the ring of files I
    have in storage.

    I will be opening an RFE to add the required function, as Erich asked
    me to.

    This problem has an interesting history going back years, to when MM
    was working on ooDialog!

    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to mberg on Thu Nov 16 09:41:46 2017
    On 11/16/2017 2:56 AM, mberg wrote:
    Am Montag, 13. November 2017 22:16:12 UTC+1 schrieb Jack:

    What about
    physicalScreenSize = .DlgUtil~screenSize('PIXELS')
    say physicalScreenSize~height
    say physicalScreenSize~width

    I use that in a method to get information about the task bar

    /*--------------------------------------------------------------------*/
    /* Method returns position of Windows TaskBar */
    /* top, bottom, left or right */
    /* and the amount of pixels that reduces the physical screen */ /*--------------------------------------------------------------------*/ ::Method taskBarPosition; /*--------------------------------------------------------------------*/
    /* Get the working Area, this is the useable screen and information */
    /* where it is on the physical screen */ /*--------------------------------------------------------------------*/
    workingAreaCornerPoints = .DlgUtil~screenArea()
    workingAreaSize = .DlgUtil~screenSize('P')
    if workingAreaCornerPoints~left <> 0 Then return "left" workingAreaCornerPoints~left;
    if workingAreaCornerPoints~top <> 0 Then return "top" workingAreaCornerPoints~top;
    /*--------------------------------------------------------------------*/
    /* get the screen size in Pixels, this is the physical screen */ /*--------------------------------------------------------------------*/
    physicalScreenSize = .DlgUtil~screenSize('PIXELS')
    if workingAreaCornerPoints~bottom <> physicalScreenSize~height Then ,
    return "bottom" physicalScreenSize~height - workingAreaCornerPoints~bottom;
    else ,
    return "right" physicalScreenSize~width - workingAreaCornerPoints~right;
    Return


    That's very clever, but Jack is working with a Command Prompt window and
    needs the height and width in *characters*. That would presume some, as
    yet unnamed, fixed width font.

    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to Rony on Thu Nov 16 10:36:16 2017
    On 15.11.2017 16:06, Jack wrote:

    Anyhow, I'm not sure who Rony is, but if he can help an old man out, that would be great. If he has
    anything to do with writing code for Rexx 5.0, I wish he would look into this SysTextScreenSize()
    function and see if it couldn't return the screen size rather than the seemingly much less useful
    screen buffer size...

    On 11/15/2017 1:09 PM, Rony wrote:


    Well the function returns what "mode" returns (just enter "mode /?" on the command line to learn its
    usage).

    If you control the application and want to control the screen size, then one thing you could do is
    to set the screen size yourself at the beginning of your Rexx program with the "mode" command, e.g.


    "mode con cols=80 lines=25"
    say SysTextScreenSize() /* will return "25 80" */
    ... your code goes here ...

    If the current window is larger or smaller or has scroll bars active, then the mode command will
    maximize the window if it would fit on the screen (and reset the column and line buffers to the
    sizes given in the mode command). As a result your program will be able to rely on these sizes.

    I thought that would work, unfortunately, when you change Screen width
    with the mode command, it also changes the screen buffer size. This
    means long lines of display text will either wrap or disappear after
    reaching the buffer width. That is not what I need. Why MODE messes
    with the buffer size I don't know, but, in properties they are separate settings, so it seems logical (to me) that you could access/change them independently, but so far no go.

    --
    Jack
    I'm not young enough to know everything!
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gil Barmwater@21:1/5 to Jack on Thu Nov 16 11:35:00 2017
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window properties layout drop down.  The "window size" is also in the windows layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the
    window size so I can center text, menus and so on.  I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of 30, which is the actual numbers needed to  center text and menus, and those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large, but
    the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    Jack,

    Not knowing the history of this issue that Les alluded to, I'd guess
    that this function predates the ability in Windows to have different
    sizes for the window and the buffer. When that became possible, the
    function could either return the buffer size or the screen size and it
    does the former for some reason.

    As you noted, the properties dialog has access to and displays both
    values and there is a Windows API which will also will return both (in
    addition to several other properties such as the colors). This API is accessible if you are willing to write some C/C++ code. I have used this
    API to make it easy to manipulate the text/background colors and, with a
    bit of tweaking, could come up with a routine to return the screen size.
    The routine would require a DLL to implement the Windows API but if you
    can live with installing that, I'll spend some time writing the code.

    --
    Gil Barmwater

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to LesK on Thu Nov 16 11:32:17 2017
    On 11/15/2017 6:24 PM, LesK wrote:

    You could try 5.0.0 Beta. If you don't have a 2nd pc to test it on,
    send me a direct email and ask for ORXVER, the latest incantation of
    CHGREX as presented at a recent Rexx Language Symposium.

    I do have a second PC but think I'll just be patient and wait for the
    new release. When younger, I often played with Beta software, but as I
    age, things get complicated fast. Meaning memory is sometimes short
    lived (why did I go to the kitchen? Why did I exit this app an am on
    the command line? What buttons did I push to get here?)

    OOPS! It was a DOC bug that was closed :-( I'll try to get it set to an
    RFE, or do it myself. That will not guarantee that it will get added,
    but at least the request will be recorded.

    BTW: You could get a SourceForge userid (free and anonymous if you want)
    and participate directly with the folks that develop and fix ooRexx.
    Start at oorexx.org and there is a link to SF right after the logo.

    I am a member of SF but even when young and running on all 8 cylinders,
    I was not up to communicating with low level programers, and that goes
    in spades when talking OO stuff. I'll let the experts handle the complex
    stuff. I might add I'm really happy with ooRexx 4.xx. It works great,
    about as good as it did when I ran OS/2 Warp. Windows on the other hand, doesn't.

    I have a sneaking suspicion the SysTextScreenSize() problem is related
    to DOS mode command changing both Screen width and Screen buffer width,
    instead of individually. There might be a good reason DOS does this, but
    I'm not seeing it at the moment. Since these setting are completely
    separate in the properties, You'd think we could obtain and set them
    separately from Rexx or otherwise. In fact, all the settings in the
    window properties should be accessible and settable from Rexx. It would
    be nice to be able to set font, font size, text color, bg color and so
    on, right from your script.

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to mberg on Thu Nov 16 12:16:57 2017
    On 11/16/2017 2:56 AM, mberg wrote:
    Am Montag, 13. November 2017 22:16:12 UTC+1 schrieb Jack:

    What about
    physicalScreenSize = .DlgUtil~screenSize('PIXELS')
    say physicalScreenSize~height
    say physicalScreenSize~width

    I use that in a method to get information about the task bar

    /*--------------------------------------------------------------------*/
    /* Method returns position of Windows TaskBar */
    /* top, bottom, left or right */
    /* and the amount of pixels that reduces the physical screen */ /*--------------------------------------------------------------------*/ ::Method taskBarPosition; /*--------------------------------------------------------------------*/
    /* Get the working Area, this is the useable screen and information */
    /* where it is on the physical screen */ /*--------------------------------------------------------------------*/
    workingAreaCornerPoints = .DlgUtil~screenArea()
    workingAreaSize = .DlgUtil~screenSize('P')
    if workingAreaCornerPoints~left <> 0 Then return "left" workingAreaCornerPoints~left;
    if workingAreaCornerPoints~top <> 0 Then return "top" workingAreaCornerPoints~top;
    /*--------------------------------------------------------------------*/
    /* get the screen size in Pixels, this is the physical screen */ /*--------------------------------------------------------------------*/
    physicalScreenSize = .DlgUtil~screenSize('PIXELS')
    if workingAreaCornerPoints~bottom <> physicalScreenSize~height Then ,
    return "bottom" physicalScreenSize~height - workingAreaCornerPoints~bottom;
    else ,
    return "right" physicalScreenSize~width - workingAreaCornerPoints~right;
    Return

    Thanks for this. I marked it to look at a little later when feeling the
    urge to attack Methods, Inheritance, Classes, Sub-Classes, Super-Classes
    and all those words that kicked my butt enough times to impose a huge
    mental block against OO. Your first few lines look almost familar to
    me, like how I might use a stem:

    physicalScreenSize.height
    physicalScreenSize.width

    However, the ".DlgUtil~screenSize('PIXELS')" gives me nightmares.
    What is .DlgUtil
    To me, a "." in Rexx designates a stem, a "~" in Unix was negation.

    I think I may have gone past some of this before, but I recall thinking
    why am I doing this to myself, I already know how to do it in classic rexx.

    Any way, your code snippets might encourage me to try yet again, so I'll
    likely be praising you or cursing you for this later:-) (Kidding of
    course, I'd never curse one who tries to help the helpless)
    I'd be willing to try hard if I could get ScreenSize('Characters')
    rather than Pixels, or convert ScreenPixel.width into ScreenCharacter.width

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to LesK on Thu Nov 16 12:34:20 2017
    On 11/16/2017 9:05 AM, LesK wrote:

    Rony: That doesn't Meet Requirements. As Jack explained,
    SysTextScreenSize() does NOT return the screen size, it returns the
    BUFFER size and he wants his buffer to be a lot larger than the screen
    so it can hold more historical data.

    This is exactly correct. I can set buffer width to say, 500 characters
    and screen width to 200 characters. If a line of text has more than 200 characters, it continues on without wrapping, and DOS puts a scroll bar
    at the bottom of the screen. SysTextScreenSize() returns the 500
    character buffer width instead of the 200 character screen width, so
    centering text/menus etc is not possible based on the buffer width.

    I will be opening an RFE to add the required function, as Erich asked
    me to.

    This problem has an interesting history going back years, to when MM
    was working on ooDialog!

    If they manage to figure this out, they might as well go for the grand
    slam and get the rest of the info contained in the window properties, as
    it's likely all inter-related. Wonder if Windows PowerShell has
    something like this? I've had my butt kicked by Powershell as well as
    C++ and Object Rexx. I think my brain terminated at learning basic C,
    all of which I've forgotten over the years...

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to Jack on Thu Nov 16 13:03:09 2017
    On 11/16/2017 12:34 PM, Jack wrote:

    Replying to myself, I know:

    If they manage to figure this out, they might as well go for the grand
    slam and get the rest of the info contained in the window properties, as
    it's likely all inter-related. Wonder if Windows PowerShell has
    something like this? I've had my butt kicked by Powershell as well as
    C++ and Object Rexx. I think my brain terminated at learning basic C,
    all of which I've forgotten over the years...

    Wondered over to "MS the script guy" and I might be on to something:

    https://blogs.technet.microsoft.com/heyscriptingguy/2006/12/04/how-can-i-expand-the-width-of-the-windows-powershell-console/


    I think this might get me somewhere, but first, I have to take a deep
    breath and dive into PowerShell yet again. Never did get very far with
    it, much like my OO attempts.

    It appears the power shell allows you to set the console (screen)
    properties from a powershell script, AND set separate buffer size and
    Screen size settings.

    I assume I can run my Rexx from a power shell, pass the powershell
    script to the console, and grab/set the info I need from there. Have to
    look into that as well... I'm thinking if PowerShell can do it, then
    Rexx can get there as well. I've been wrong before, but here goes...

    The plot thickens...

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to Gil Barmwater on Thu Nov 16 15:26:37 2017
    On 11/16/2017 11:35 AM, Gil Barmwater wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down. The "window size" is also in the windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size. The buffer is the
    length of a string before it is wrapped to the next line. I want the
    window size so I can center text, menus and so on. I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140 and height of
    30, which is the actual numbers needed to center text and menus, and
    those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    Jack,

    Not knowing the history of this issue that Les alluded to, I'd guess
    that this function predates the ability in Windows to have different
    sizes for the window and the buffer. When that became possible, the
    function could either return the buffer size or the screen size and it
    does the former for some reason.

    As you noted, the properties dialog has access to and displays both
    values and there is a Windows API which will also will return both (in addition to several other properties such as the colors). This API is accessible if you are willing to write some C/C++ code. I have used this
    API to make it easy to manipulate the text/background colors and, with a
    bit of tweaking, could come up with a routine to return the screen size.
    The routine would require a DLL to implement the Windows API but if you
    can live with installing that, I'll spend some time writing the code.

    Thanks Gil. No need at the moment. I discovered some PowerShell code
    that accesses the properties you mentioned. I managed to write a PS1
    shell script that I can change following.

    ForegroundColor : DarkBlue
    BackgroundColor : Gray
    CursorPosition : 0,0
    WindowPosition : 0,0
    CursorSize : 25
    BufferSize : 500,9001
    WindowSize : 190,40
    MaxWindowSize : 240,56
    MaxPhysicalWindowSize : 240,56
    KeyAvailable : False
    WindowTitle : C:\WINDOWS\system32\cmd.exe

    I've verified in a powershell window, I can run a PS1 script and change
    or access all of these. Now I just have to figure out how to get this integrated into my Rexx code. I think I'll look into having powershell
    my default command shell and if push comes to shove, I could run my rexx
    scrips from a ps1 script.

    I can grab any DOS output from within REXX so I should be able to grab
    stuff from PS. Did I mention PowerShell gives me fits, cause it does.
    Just figuring out how to open a PowerShell window takes amazing effort...

    In case anyone is interested in running a Powershell script, here is
    what I have so far:
    _________________________________________
    # PowerShell script changes window buffer and window size properties

    cls
    $pshost = Get-Host
    $pswindow = $pshost.ui.rawui

    echo $pswindow #lists all the attributes of the window

    echo "Original Buffer Size:"
    $pswindow.buffersize # list original buffersize Width and Height

    echo "Original Window Size: "
    $pswindow.WindowSize #lists the original windowSize, width and height

    $newBUFFERsize = $pswindow.buffersize
    $newTEXTsize = $pswindow.WindowSize

    $newBUFFERsize.height = 9001
    $newBUFFERsize.width = 500

    #set the buffersize height, width
    $pswindow.buffersize = $newBUFFERsize

    $newTEXTsize.height = 40
    $newTEXTsize.width = 190

    # Set the WindowSize Width and Height
    $pswindow.WindowSize = $newTextSize

    # lists the new buffersize
    echo "New Window.buffersize: " $pswindow.buffersize

    # lists the new Window size
    echo "New Window.windowsize: " $pswindow.windowsize

    I know this isn't rexx code, but, at least I'm on track to get Rexx to
    do what I need done, and my hobby marches on...
    --
    Jack
    I have not failed. I've just found ten thousand ways that won't work. http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From LesK@21:1/5 to Jack on Fri Nov 17 05:45:36 2017
    On 11/16/2017 3:26 PM, Jack wrote:
    On 11/16/2017 11:35 AM, Gil Barmwater wrote:
    On 11/13/2017 4:16 PM, Jack wrote:

    When trying to obtain a screen size for a text window in Win 10, I use
    this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window
    properties layout drop down.  The "window size" is also in the windows
    layout properties window, but this value is ignored.

    The buffer size is not the same as window size.  The buffer is the
    length of a string before it is wrapped to the next line.  I want the
    window size so I can center text, menus and so on.  I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140  and height of
    30, which is the actual numbers needed to  center text and menus, and
    those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large,
    but the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    Jack,

    Not knowing the history of this issue that Les alluded to, I'd guess
    that this function predates the ability in Windows to have different
    sizes for the window and the buffer. When that became possible, the
    function could either return the buffer size or the screen size and it
    does the former for some reason.

    As you noted, the properties dialog has access to and displays both
    values and there is a Windows API which will also will return both (in
    addition to several other properties such as the colors). This API is
    accessible if you are willing to write some C/C++ code. I have used this
    API to make it easy to manipulate the text/background colors and, with a
    bit of tweaking, could come up with a routine to return the screen size.
    The routine would require a DLL to implement the Windows API but if you
    can live with installing that, I'll spend some time writing the code.

    Thanks Gil. No need at the moment.  I discovered some PowerShell code
    that accesses the properties you mentioned.  I managed to write a PS1
    shell script that I can change following.

    ForegroundColor       : DarkBlue
    BackgroundColor       : Gray
    CursorPosition        : 0,0
    WindowPosition        : 0,0
    CursorSize            : 25
    BufferSize            : 500,9001
    WindowSize            : 190,40
    MaxWindowSize         : 240,56
    MaxPhysicalWindowSize : 240,56
    KeyAvailable          : False
    WindowTitle           : C:\WINDOWS\system32\cmd.exe

    I've verified in a powershell window, I can run a PS1 script and change
    or access all of these. Now I just have to figure out how to get this integrated into my Rexx code. I think I'll look into having powershell
    my default command shell and if push comes to shove, I could run my rexx scrips from a ps1 script.

    I can grab any DOS output from within REXX so I should be able to grab
    stuff from PS.  Did I mention PowerShell gives me fits, cause it does.
    Just figuring out how to open a PowerShell window takes amazing effort...

    In case anyone is interested in running a Powershell script, here is
    what I have so far:
    _________________________________________
    # PowerShell script changes window buffer and window size properties

    cls
    $pshost   = Get-Host
    $pswindow = $pshost.ui.rawui

    echo $pswindow        #lists all the attributes of the window

    echo "Original Buffer Size:"
    $pswindow.buffersize  # list original buffersize Width and Height

    echo "Original Window Size: "
    $pswindow.WindowSize  #lists the original windowSize, width and height

    $newBUFFERsize = $pswindow.buffersize
    $newTEXTsize   = $pswindow.WindowSize

    $newBUFFERsize.height = 9001
    $newBUFFERsize.width  = 500

    #set the buffersize height, width
    $pswindow.buffersize  = $newBUFFERsize

    $newTEXTsize.height  = 40
    $newTEXTsize.width   = 190

    # Set the WindowSize Width and Height
    $pswindow.WindowSize = $newTextSize

    # lists the new buffersize
    echo "New Window.buffersize: " $pswindow.buffersize

    # lists the new Window size
    echo "New Window.windowsize: " $pswindow.windowsize

    I know this isn't rexx code, but, at least I'm on track to get Rexx to
    do what I need done, and my hobby marches on...

    RFE 702 has been posted to SF:

    Please extend the functionality of SysTextScreenSize() to return the
    actual screen size (Height and Width) in characters, instead of just the
    buffer size. If any other information is readily available, please allow
    for it as well. Classic Rexx usability is preferable.

    See DOC bug #214 and the original code bug ticket was moved from /p/oorexx/bugs/1254
    according to Mark's note.

    --

    Les (Change Arabic to Roman to email me)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hex@21:1/5 to All on Sat Nov 18 01:07:12 2017
    Den måndag 13 november 2017 kl. 22:16:12 UTC+1 skrev Jack:
    When trying to obtain a screen size for a text window in Win 10, I use this:

    parse value SysTextScreenSize() with row col

    This returns the "window buffer size" Width and Height in the window properties layout drop down. The "window size" is also in the windows layout properties window, but this value is ignored.

    The buffer size is not the same as window size. The buffer is the
    length of a string before it is wrapped to the next line. I want the
    window size so I can center text, menus and so on. I want the buffer
    size to be large, while the actual window size some fraction of my
    actual screen size.

    For example, if my screen buffer size has a width of 500 and
    height of 9001, my row and col will be set to 9001 row, 500 col.
    However, my actual window size is set to width of 140 and height of 30, which is the actual numbers needed to center text and menus, and those numbers are ignored by Rexx.

    I can set both numbers the same, but I want the buffer to be large, but
    the window width some fraction of my screen width.

    Is there a solution to this, classical Rexx preferred as I'm not
    "objective" at all:-)

    ooRexx_4.2.0(MT)_32-bit 6.04 22 Feb 2014

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    I think you will find what you need in, ooConsole written by Mark Miesfeld.
    The source is in the oorexx project, incubator directory on SF.
    You also need the ooShapes and APICmmon, also in incubator directory, to be able to compile a working ooConsole.
    Take o look in the ooConsole examples directory, you will find that the OO is not that hard for ooConsole.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to LesK on Sat Nov 18 08:23:27 2017
    On 11/17/2017 5:45 AM, LesK wrote:

    RFE 702 has been posted to SF:

    Please extend the functionality of SysTextScreenSize() to return the
    actual screen size (Height and Width) in characters, instead of just the buffer size. If any other information is readily available, please allow
    for it as well. Classic Rexx usability is preferable.

    See DOC bug #214 and the original code bug ticket was moved from /p/oorexx/bugs/1254
    according to Mark's note.

    Thanks Les. Hope they can come up with something because PowerShell is
    not cutting it for me. I have about a week of work in the past 2 days
    trying to figure out PowerShell yet again, and it is immensely
    frustrating. I know it is a powerful shell and while I can use it to
    get/change the info I want (WindowSize) I've not managed to figure out
    how to get that info into my Rexx Script, other than writing it to a
    file and then getting Rex to read the file. Way too in-elegant even for
    me, so I'm about to give up for now.

    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to hex on Sat Nov 18 08:38:31 2017
    On 11/18/2017 4:07 AM, hex wrote:

    I think you will find what you need in, ooConsole written by Mark Miesfeld. The source is in the oorexx project, incubator directory on SF.
    You also need the ooShapes and APICmmon, also in incubator directory, to be able to compile a working ooConsole.
    Take o look in the ooConsole examples directory, you will find that the OO is not that hard for ooConsole.

    Thanks for the idea, but I went to the incubator directory and found the ooConsole files. Looked at the docs, and they were empty or made no
    sense (the pdf) to me. I've put too many hours into this already for
    something that I can live w/o, and right now, my head is polluted with PowerShell code fragments dangling about.

    Also, one of the things I really like about ooRexx is I don't have to
    add all the system functions stuff like I did when I ran Rexx on OS/2
    I always thought that was weird, that every script had to start with a
    comment and then add the external functions. I don't want to do that
    again, just for the ability to get one function I need. I already gave
    myself a headache with PowerShell.
    --
    Jack
    Tolerance is the virtue of the man without convictions.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ErichSt@21:1/5 to All on Tue Nov 21 11:21:10 2017
    | RFE 702 has been posted to SF

    I've committed revision [r11329] for enhancement request #702
    The change will allow to retrieve buffer size, maximum window size, and actual window position.
    In addition it allows to set buffer size and actual window position.

    A new 5.0 beta build is available on Sourceforge at https://sourceforge.net/projects/oorexx/files/oorexx/5.0.0beta/

    As rexxutil is an external function package, it should even be possible to use the new SysTextScreenSize() functionality with ooRexx 4.2 by swapping rexxutil.dll (can be extracted from ZIP files uploaded to above mentioned location)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jack@21:1/5 to ErichSt on Tue Nov 21 17:56:42 2017
    On 11/21/2017 2:21 PM, ErichSt wrote:
    | RFE 702 has been posted to SF

    I've committed revision [r11329] for enhancement request #702
    The change will allow to retrieve buffer size, maximum window size, and actual window position.
    In addition it allows to set buffer size and actual window position.

    A new 5.0 beta build is available on Sourceforge at https://sourceforge.net/projects/oorexx/files/oorexx/5.0.0beta/

    As rexxutil is an external function package, it should even be possible to use the new SysTextScreenSize() functionality with ooRexx 4.2 by swapping rexxutil.dll (can be extracted from ZIP files uploaded to above mentioned location)

    Thanks Erich, this will be a welcome change. I'd like to thank Les and
    Gil for their help in this issue, particularly Gil, who made a .DLL for
    me that provides a new function scrnsize() that does exactly what I
    thought SysTextScreenSize() should do.

    Now, I've added this to my scripts that need it, and all is wonderful.

    parse value scrnsize() with row col /*call to external routine
    scrnsize.dll added at end of script */

    Now,

    say center("Gil is Great, thank you very much", col)

    will always put him in the center.

    Thanks guys.
    --
    Jack
    An ounce of application is worth a ton of abstraction.
    http://jbstein.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)