1. console routines
- Posted by SDPringle Nov 08, 2014
- 1688 views
In writing a MYSQL wrapper for EUPHORIA, I found that for demos it is useful to have a way to determine the number of columns and rows. Please comment on whether we should have a colums() and rows() routine in std/console.e that returns these values.
2. Re: console routines
- Posted by ryanj Nov 08, 2014
- 1598 views
In writing a MYSQL wrapper for EUPHORIA, I found that for demos it is useful to have a way to determine the number of columns and rows. Please comment on whether we should have a colums() and rows() routine in std/console.e that returns these values.
I believe video_config() does that. I've never used it myself, since I only do GUI programming.
3. Re: console routines
- Posted by SDPringle Nov 09, 2014
- 1592 views
You're right. I am surprised it is still here. A lot of routines like this one, were DOS32 specific and thus unavailable in my O.S. and 4.0 and up.
Thanks Ryan.
Shawn
4. Re: console routines
- Posted by jimcbrown (admin) Nov 09, 2014
- 1543 views
You're right. I am surprised it is still here. A lot of routines like this one, were DOS32 specific and thus unavailable in my O.S. and 4.0 and up.
Thanks Ryan.
Shawn
Some parts of video_config() might have been DOS32 specific, but the rows/columns bit always worked on nix and the windoze console. Which is why that routine is still around.
5. Re: console routines
- Posted by ChrisB (moderator) Nov 09, 2014
- 1505 views
Hi
They are still there, and still work, and it's vital they are not removed. I used variable sized console windows and need to get the size for positioning and displaying characters.
Chris
6. Re: console routines
- Posted by Shian_Lee Nov 11, 2014
- 1508 views
In writing a MYSQL wrapper for EUPHORIA, I found that for demos it is useful to have a way to determine the number of columns and rows. Please comment on whether we should have a colums() and rows() routine in std/console.e that returns these values.
No doubts that the std/console.e should have a columns() and rows() routines. It is extremely useful. video_config() returns correct values when opening a new terminal - but not after resizing the terminal. That's a problem that was exist with DOS after executing system(), which by the way I personally solved by examining the BIOS area and then calling DOS interrupts if necessary, and it worked perfectly (unluckily I've lost the source code - as usual).
For the GUI generation of programmers, it's important to know that console utilities and applications, are much more efficient and straightforward to write. Console programming is not a luxury - it's an essential part of a serious and mature all-purpose-language.
Many fancy GUI programs are useless if you cannot start the GUI environment. Without console programs and utilities I guess that the global communication would've been broken all the time.
Euphoria must continue to maintain console routines since this is one of the great aspects of this language.
p.s. The mobile stuff, cellphones, watches, etc - are all toys, fashion, luxury. All-purpose-language for PC must remain All-purpose for serious programming. Why waste the time on suppling support for temporary fashions as android which is mostly great for bored kids and for making money.
7. Re: console routines
- Posted by DerekParnell (admin) Nov 11, 2014
- 1504 views
No doubts that the std/console.e should have a columns() and rows() routines. It is extremely useful. video_config() returns correct values when opening a new terminal - but not after resizing the terminal.
It could be that you are using an older version of Euphoria. I've been testing V4.1 and using this program below, it shows that it does reflect the real-time console values - at least on Windows. I'm not using a Unix so I can't comment on that.
include std/console.e sequence o, n clear_screen() o = "" n = video_config() while 1 do if not equal(o,n) then position(1,1) puts(1, " ") position (1,1) ? n o = n end if n = video_config() end while
8. Re: console routines
- Posted by Shian_Lee Nov 11, 2014
- 1543 views
Thank you,
I am using Linux and Euphoria 4.1.0, and I had a problem after resizing the terminal.
But when I'll get back, I will copy your code and do more tests. maybe I've missed something.
9. Re: console routines
- Posted by K_D_R Nov 11, 2014
- 1463 views
Two Thumbs Up for Shian Lee's comments above!
10. Re: console routines
- Posted by Shian_Lee Nov 12, 2014
- 1433 views
No doubts that the std/console.e should have a columns() and rows() routines. It is extremely useful. video_config() returns correct values when opening a new terminal - but not after resizing the terminal.
It could be that you are using an older version of Euphoria. I've been testing V4.1 and using this program below, it shows that it does reflect the real-time console values - at least on Windows. I'm not using a Unix so I can't comment on that.
include std/console.e sequence o, n clear_screen() o = "" n = video_config() while 1 do if not equal(o,n) then position(1,1) puts(1, " ") position (1,1) ? n o = n end if n = video_config() end while
Right now I am using LinuxMint-17 64-bit, Euphoria v4.1.0, and the default MATE Terminal 1.8.0.
The code above does not work. It looks like on Linux there is no way to tell the rows/columns after resizing the terminal (same as in DOS after calling system()).
Is it a bug? I have no idea.
11. Re: console routines
- Posted by jimcbrown (admin) Nov 12, 2014
- 1426 views
Right now I am using LinuxMint-17 64-bit, Euphoria v4.1.0, and the default MATE Terminal 1.8.0.
The code above does not work.
Is it a bug? I have no idea.
I'd say it's a bug.
It looks like on Linux there is no way to tell the rows/columns after resizing the terminal (same as in DOS after calling system()).
Hmm. What happens if you add text_rows() calls?
include std/console.e sequence o, n clear_screen() o = "" text_rows(999) n = video_config() while 1 do if not equal(o,n) then position(1,1) puts(1, " ") position (1,1) ? n o = n end if text_rows(999) n = video_config() end while
12. Re: console routines
- Posted by Shian_Lee Nov 13, 2014
- 1382 views
Right now I am using LinuxMint-17 64-bit, Euphoria v4.1.0, and the default MATE Terminal 1.8.0.
The code above does not work.
Is it a bug? I have no idea.
I'd say it's a bug.
It looks like on Linux there is no way to tell the rows/columns after resizing the terminal (same as in DOS after calling system()).
Hmm. What happens if you add text_rows() calls?
include std/console.e sequence o, n clear_screen() o = "" text_rows(999) n = video_config() while 1 do if not equal(o,n) then position(1,1) puts(1, " ") position (1,1) ? n o = n end if text_rows(999) n = video_config() end while
After adding text_rows(999) - the code works perfectly! Then I hope this bug can be fixed!
13. Re: console routines
- Posted by jimcbrown (admin) Nov 13, 2014
- 1401 views
After adding text_rows(999) - the code works perfectly! Then I hope this bug can be fixed!
Someone should add a ticket for this bug...