1. console routines

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.

new topic     » topic index » view message » categorize

2. Re: console routines

SDPringle said...

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: console routines

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

new topic     » goto parent     » topic index » view message » categorize

4. Re: console routines

SDPringle said...

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.

new topic     » goto parent     » topic index » view message » categorize

5. Re: console routines

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

new topic     » goto parent     » topic index » view message » categorize

6. Re: console routines

SDPringle said...

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.

new topic     » goto parent     » topic index » view message » categorize

7. Re: console routines

Shian_Lee said...

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 
 
new topic     » goto parent     » topic index » view message » categorize

8. Re: console routines

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.

new topic     » goto parent     » topic index » view message » categorize

9. Re: console routines

Two Thumbs Up for Shian Lee's comments above!

new topic     » goto parent     » topic index » view message » categorize

10. Re: console routines

DerekParnell said...
Shian_Lee said...

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.

new topic     » goto parent     » topic index » view message » categorize

11. Re: console routines

Shian_Lee said...

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.

Shian_Lee said...

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 
 
new topic     » goto parent     » topic index » view message » categorize

12. Re: console routines

jimcbrown said...
Shian_Lee said...

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.

Shian_Lee said...

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!

new topic     » goto parent     » topic index » view message » categorize

13. Re: console routines

Shian_Lee said...

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...

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu