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
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
On 11/13/2017 5:30 PM, LesK wrote:
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
On 11/14/2017 10:04 PM, Jack wrote:
On 11/13/2017 5:30 PM, LesK wrote:You've explained the problem nicely, but what *application* are you going to use to write to the
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
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.
On 11/14/2017 10:04 PM, Jack wrote:
On 11/13/2017 5:30 PM, LesK wrote:You've explained the problem nicely, but what *application* are you
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
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.
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:You've explained the problem nicely, but what *application* are you
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
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...
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:You've explained the problem nicely, but what *application* are you
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
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...
On 11/15/2017 10:06 AM, Jack wrote:
On 11/14/2017 11:51 PM, LesK wrote:The Change list for 5.0.0 Beta shows an entry for this, but I can't get Sourceforge to show it to me.
On 11/14/2017 10:04 PM, Jack wrote:
On 11/13/2017 5:30 PM, LesK wrote:You've explained the problem nicely, but what *application* are you
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
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...
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.
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:You've explained the problem nicely, but what *application* are you
On 11/13/2017 4:16 PM, Jack wrote:
What will you be using to drive the screen?
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
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.
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
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
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...
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.
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
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.
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
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 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...
On 11/13/2017 4:16 PM, Jack wrote:
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
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.
On 11/16/2017 11:35 AM, Gil Barmwater wrote:
On 11/13/2017 4:16 PM, Jack wrote:Thanks Gil. No need at the moment. I discovered some PowerShell code
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
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.
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...
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
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.
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.
| 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)
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:58:06 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,333,698 |
Posted today: | 1 |