Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
8 crawler(s) on-line.
 101 guest(s) on-line.
 1 member(s) on-line.


 Hammer

You are an anonymous user.
Register Now!
 Hammer:  44 secs ago
 Hypex:  14 mins ago
 MEGA_RJ_MICAL:  35 mins ago
 michalsc:  40 mins ago
 kolla:  59 mins ago
 roar:  1 hr 15 mins ago
 ppcamiga1:  1 hr 21 mins ago
 Gunnar:  1 hr 24 mins ago
 agami:  1 hr 31 mins ago
 billt:  3 hrs 8 mins ago

/  Forum Index
   /  Amiga OS4.x \ Workbench 4.x
      /  Using new CON window specifications
Register To Post

Goto page ( 1 | 2 Next Page )
PosterThread
Hypex 
Using new CON window specifications
Posted on 18-Jul-2009 14:35:53
#1 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

Hello.

I've been testing out the new specifications for console windows. I'm quite interested in the new COLUMNS and ROWS keywords. But am wondering how much they can do. For instance in the text is says they can substitute the x and y position with characters instead of pixels. While this sounds like a good idea, why is it only for the x and y position? What abput the width and height?

I would have thought that specifying the width and height in characters would be a more logical specification, since one could program the window to fit the exact width of characters and lines they need. Perhaps even displaying the window on a centred axis.

I did some testing and this seems not to be the case. The x and y seemed to work, but the width and height remained as pixel sizes. So what is the point of only having x and y here? Another thing that would help, is there any way a shell script can get the screen width and height to calculate a window size for itself?

Apart from that, is there any way for a console window to wait, say ten seconds after the program has quit so the contents can still be seen? I either get a window that closes as soon as the text is displayed (like for Echo) or one that hangs around until the user closes it.

 Status: Offline
Profile     Report this post  
AmigaPhil 
Re: Using new CON window specifications
Posted on 18-Jul-2009 15:18:13
#2 ]
Cult Member
Joined: 21-Jan-2005
Posts: 563
From: Earth (Belgium)

@Hypex

Quote:
Another thing that would help, is there any way a shell script can get the screen width and height to calculate a window size for itself?


I don't think you can achieve that with just an AmigaDOS script. It's possible with an ARexx script however.

Quote:
Apart from that, is there any way for a console window to wait, say ten seconds after the program has quit so the contents can still be seen? I either get a window that closes as soon as the text is displayed (like for Echo) or one that hangs around until the user closes it.


Just add "wait 10" in your script.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Using new CON window specifications
Posted on 18-Jul-2009 15:33:27
#3 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@AmigaPhil

Quote:
I don't think you can achieve that with just an AmigaDOS script. It's possible with an ARexx script however.


By reading system structures?

Quote:
Just add "wait 10" in your script.


That's the problem. I don't have that luxury. I open the console window for one CLI program so I can't wait 10 after it. This kind of subject was spoken about with regard to using pipes. Perhaps running a script instead of a program is one solution.

 Status: Offline
Profile     Report this post  
AmigaPhil 
Re: Using new CON window specifications
Posted on 18-Jul-2009 16:13:24
#4 ]
Cult Member
Joined: 21-Jan-2005
Posts: 563
From: Earth (Belgium)

@Hypex

Quote:
By reading system structures?


Here is how to get the screen size with ARexx:


IF SHOW('L', 'rexxsupport.library') THEN DO
intui = SHOWLIST(l, 'intuition.library',, a)
CALL FORBID()
screeninfo = NEXT(intui, 56) /* IntuitionBase->ActiveScreen */
screenx = C2D(IMPORT(OFFSET(screeninfo, 12), 2)) /* Screen->Width */
screeny = C2D(IMPORT(OFFSET(screeninfo, 14), 2)) /* Screen->Height */
CALL PERMIT()
END


Have a look at SpamFryer on Aminet. It opens its output window with a size proportional to the screen size.


Quote:
That's the problem. I don't have that luxury. I open the console window for one CLI program so I can't wait 10 after it. This kind of subject was spoken about with regard to using pipes. Perhaps running a script instead of a program is one solution.


Not sure if this will work in your case, but...
How about launching your program from a shell script (let's call it "MyProg.launch"):

cd "Path/To/Your/Program"
YourProgram
wait 10
endshell

Then start YourProgram with:
newshell "con:x/y/width/height/windows title/auto/close" "MyProg.launch"

 Status: Offline
Profile     Report this post  
AmigaPhil 
Re: Using new CON window specifications
Posted on 18-Jul-2009 16:47:31
#5 ]
Cult Member
Joined: 21-Jan-2005
Posts: 563
From: Earth (Belgium)

Quote:
Have a look at SpamFryer on Aminet. It opens its output window with a size proportional to the screen size.


...and rxlistview (used in SpamFryer 6:18) for an example on how to adjust the window size to the font size.

 Status: Offline
Profile     Report this post  
Xenic 
Re: Using new CON window specifications
Posted on 19-Jul-2009 1:48:01
#6 ]
Super Member
Joined: 2-Feb-2004
Posts: 1246
From: Pennsylvania, USA

@Hypex
Quote:
Apart from that, is there any way for a console window to wait, say ten seconds after the program has quit so the contents can still be seen? I either get a window that closes as soon as the text is displayed (like for Echo) or one that hangs around until the user closes it.

It's unclear if you are opening a console from within a program or sending output to a console window from a script but if you're doing it in a script I don't think you can time the console window closing with AmigaDOS commands without creating a shell window with a script as suggested. However, if you're running the command from a script, you can redirect the output to a temporary file or and display the relulting output in an AmigaDOS "requestchoice"
requester which has a TIMEOUT option.

_________________
X1000 with 2GB memory & OS4.1FE

 Status: Offline
Profile     Report this post  
tonyw 
Re: Using new CON window specifications
Posted on 19-Jul-2009 5:15:09
#7 ]
Elite Member
Joined: 8-Mar-2003
Posts: 3240
From: Sydney (of course)

@Hypex

I don't fully understand your confusion here. The ROWS and COLUMNS values are characters, eg "ROWS=25/COLUMNS=80" will override all other dimensions and open a window that is 80 characters wide and 25 rows high. You can still resize it afterwards but it opens at that size.
Any width or height that you give it on the same command line is ignored. The only exception is when the resulting window is too big to be opened on the screen and is limited to the screen size.

Re a delay in closing: your application (program or script) has to make the delay before closing the window.

_________________
cheers
tony

Hyperion Support Forum: http://forum.hyperion-entertainment.biz/index.php

 Status: Offline
Profile     Report this post  
Hypex 
Re: Using new CON window specifications
Posted on 20-Jul-2009 15:21:21
#8 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@Xenic

Sorry Xenic, yes I am running it from a script. Just redirecting command like so:

;Script example
Command >CON:////... ARGUMENTS

 Status: Offline
Profile     Report this post  
Hypex 
Re: Using new CON window specifications
Posted on 20-Jul-2009 15:33:57
#9 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@tonyw

Quote:
I don't fully understand your confusion here. The ROWS and COLUMNS values are characters, eg "ROWS=25/COLUMNS=80" will override all other dimensions and open a window that is 80 characters wide and 25 rows high. You can still resize it afterwards but it opens at that size.


That's what I thought it was at first. However when I tested the following it didn't work:
CON:////Name/ROWS/100/COLUMNS/100

All that happened was that it offset the x and y position, which is what the document says. Trying to use ROWS and COLUMNS as a switch and specifying characters in place of x/y/w/h also didn't work.

Quote:
Any width or height that you give it on the same command line is ignored. The only exception is when the resulting window is too big to be opened on the screen and is limited to the screen size.


As I understood it the x and y was ignored if ROWS and COLUMNS were specified But, I saw no mention of width and height. So are does that mean that your keywords "ROWS=25/COLUMNS=80" should be put in place of the usual width and height? See, this is why I am confused about this. I couldn't get any thing to work to specify the character width and height!

That and the doc only mentioned x and y regarding ROWS and COLUMNS that I could see. Apart from that an example would be nice. Some things are only understood fully with an example. I wouldn't expect everybody to understand my instructions.

 Status: Offline
Profile     Report this post  
broadblues 
Re: Using new CON window specifications
Posted on 20-Jul-2009 16:28:46
#10 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@Hypex

Where is this described?

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
ZeroG 
Re: Using new CON window specifications
Posted on 20-Jul-2009 16:36:58
#11 ]
Cult Member
Joined: 16-Jul-2004
Posts: 544
From: Germany

@broadblues

SYS:Documentation/con-handler.doc

 Status: Offline
Profile     Report this post  
broadblues 
Re: Using new CON window specifications
Posted on 20-Jul-2009 16:40:48
#12 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@broadblues

Okay found it console-handler.doc in the autodocs for anyone else who is ineterested.

You need to do

something like

echo "foo bar" >"CON:10/20/200/60/foo/auto/wait/rows=30/columns=50"

The quote arrond the CON: file name is *required* (else the = get interpreted by the shell)

The docs quite clearly state

Quote:

Prior to V51, options and their parameters could be separated by
exactly one blank space. Starting with V51, any number of blank
spaces and exactly one '=' character can be used to separate
options and their parameters.


Note option values are not seperated by slashes but white space or "=" signs.

The autodoc does seem to be inaccurate when it says that rows and columns overide the x & y values though, they do infact overide the width and height (which is much more logical)



_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
broadblues 
Re: Using new CON window specifications
Posted on 20-Jul-2009 16:41:29
#13 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@ZeroG

Hah! You just got there before me

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
AmigaPhil 
Re: Using new CON window specifications
Posted on 20-Jul-2009 19:09:08
#14 ]
Cult Member
Joined: 21-Jan-2005
Posts: 563
From: Earth (Belgium)

@Hypex

Quote:
Sorry Xenic, yes I am running it from a script. Just redirecting command like so:
;Script example
Command >CON:////... ARGUMENTS


So you don't even need to redirect the output to a temp. file; the above example "launch" script should work for you.

If you don't want to type the newshell command line each time you want to run your program, why not use an icon:
- create a tool type icon
- enter c:iconx as default tool
- enter WINDOW="con:x/y/width/height/title/auto/close/rows=r/columns=c" as tool option

Note:
x and y set the position of the top left corner of the window on the screen. If you omit them, the minimum is assumed (so, top left corner of the screen).
width is ... the width of the window. If you omit it, the maximum available width is used (that is to the right border of the screen).
And if you omit the height parameter, a minimum value is defaulted.

I don't know the details about the new "rows" and "columns" parameters in OS4.x, but I guess that if you use them, you can leave empty the width and height values.
(I can't check it here, but I don't think x and y are ignored when using rows and columns, that does not make sense; or is it a bug ?)

 Status: Offline
Profile     Report this post  
tonyw 
Re: Using new CON window specifications
Posted on 21-Jul-2009 0:00:48
#15 ]
Elite Member
Joined: 8-Mar-2003
Posts: 3240
From: Sydney (of course)

@AmigaPhil

As I said earlier, the ROWS and COLUMNS options override any width or height settings. So it doesn't matter whether you say "T/L/W/H/" or "T/L///", the ROWS and COLUMNS values set the initial size of the window.

('T' means Top, 'L' means Left, 'W' means Width and 'H' means Height)

@Hypex: Use the form "ROWS=25", not "ROWS/25".

Also, I should point out (if it isn't obvious) that the options like ROWS are case insensitive, ie "rows" or "Rows" works just as well.

Last edited by tonyw on 21-Jul-2009 at 12:03 AM.
Last edited by tonyw on 21-Jul-2009 at 12:02 AM.

_________________
cheers
tony

Hyperion Support Forum: http://forum.hyperion-entertainment.biz/index.php

 Status: Offline
Profile     Report this post  
Hypex 
Re: Using new CON window specifications
Posted on 21-Jul-2009 13:55:46
#16 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@AmigaPhil

Quote:
Have a look at SpamFryer on Aminet. It opens its output window with a size proportional to the screen size.



Thanks for the link and the script.

Quote:
Not sure if this will work in your case, but... newshell "con:x/y/width/height/windows title/auto/close" "MyProg.launch"


I tried this, but it didn't work. And in actual fact I can run the program and redirect the output in the usual manner.

Quote:
So you don't even need to redirect the output to a temp. file; the above example "launch" script should work for you.


Yes, it does. I just need to run the program in an external script if I want it to wait.

Quote:
If you don't want to type the newshell command line each time you want to run your program, why not use an icon:


I need the output of of necessit, not because I want it myself. I usually run my scripts "hidden" that only communicate with system and file requesters. I'd really prefer a neater solution to a simple CON window but AFAIK there is no new command that can be piped into, say the output of a comnmand, and display it's progress neatly in a window with a bar and cancel button.

Quote:
x and y set the position of the top left corner of the window on the screen. If you omit them, the minimum is assumed (so, top left corner of the screen).


Which I don't mind.

Quote:
width is ... the width of the window. If you omit it, the maximum available width is used (that is to the right border of the screen).And if you omit the height parameter, a minimum value is defaulted.



Which sounds fine except the height is usually too low by default.

Quote:
I don't know the details about the new "rows" and "columns" parameters in OS4.x, but I guess that if you use them, you can leave empty the width and height values.(I can't check it here, but I don't think x and y are ignored when using rows and columns, that does not make sense; or is it a bug ?)


I was leaving them empty then thought I should try filling them. The doc said that c and y were modified, so it doesn't make sense to me either.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Using new CON window specifications
Posted on 21-Jul-2009 14:08:05
#17 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@broadblues

Quote:
Where is this described?


Here is the relevant entries confusing me:

Quote:
CON:x/y/width/height/title/options
...
Use slashes to separate the parameters and options.
...
COLUMNS

Specify the number of columns in the window to opened, given
as the number of characters rather than as pixels. This option
overrides the 'x' parameter of the window specification.
..
ROWS

Specify the number of rows in the window to opened, given as
the number of characters rather than as pixels. This option
overrides the 'y' parameter of the window specification.
...
Starting with V51, any number of blank
spaces and exactly one '=' character can be used to separate
options and their parameters.


As you can see from reading this I ascertain that the 'x' and 'y' parameters can be specified as characters but not the 'width' and 'height' as these are not mentioned, that I can use slashes to seperate the options and paramaters as is standard in a CON window specification, and the last line says I can use a '=' sign in place of a slash. I note that is doesn't say I must, only that I can.

Now, does this clear it all up for everybody, why I was confused about how these parameters work? And what they can do for me.

Last edited by Hypex on 21-Jul-2009 at 02:09 PM.

 Status: Offline
Profile     Report this post  
Hypex 
Re: Using new CON window specifications
Posted on 21-Jul-2009 14:16:39
#18 ]
Elite Member
Joined: 6-May-2007
Posts: 11229
From: Greensborough, Australia

@tonyw

Quote:
Use the form "ROWS=25", not "ROWS/25".


@broadblues

Quote:
echo "foo bar" >"CON:10/20/200/60/foo/auto/wait/rows=30/columns=50"


Yes, thanks guys, that one works on my system.

Good tip about the quotes, infact I did put them in my script, but not during testing since I used no spaces. And did wonder at first if I could use quotes on a redirection.

Now it looks like we just have to amend the docs.

 Status: Offline
Profile     Report this post  
broadblues 
Re: Using new CON window specifications
Posted on 21-Jul-2009 14:23:45
#19 ]
Amiga Developer Team
Joined: 20-Jul-2004
Posts: 4446
From: Portsmouth England

@Hypex

Quote:

and the last line says I can use a '=' sign in place of a slash. I note that is doesn't say I must, only that I can.


No it does say that, it doesn't mention slashes at all in that context, it mentions whitespace. Slashes sepaerate options, whitespace (and now an = sign) seperate options from their parameter. the section immediatly before that which you quoted starting "prior to version 51" gives the clue about that.

The bit about x & y is definetely wrong though, you are right about that.

Last edited by broadblues on 21-Jul-2009 at 02:25 PM.

_________________
BroadBlues On Blues BroadBlues On Amiga Walker Broad

 Status: Offline
Profile     Report this post  
thinkchip 
Re: Using new CON window specifications
Posted on 21-Jul-2009 15:09:03
#20 ]
Super Member
Joined: 26-Mar-2004
Posts: 1183
From: Salt Lake City, Utah, USA

Just wondering if proportional fonts are allowed in console windows. That could have a big affect on the size of the windows.

_________________
X5000 / microA1(OS4.1 FE U2) / CodeBench / Imagine / Blender
Lightwave 2019 / Microsoft Visual C++

 Status: Offline
Profile     Report this post  
Goto page ( 1 | 2 Next Page )

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle