Author Topic: Does a "window" function exist in console  (Read 1889 times)

0 Members and 1 Guest are viewing this topic.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
Does a "window" function exist in console
« on: May 06, 2019, 05:56:49 pm »
I am not sure if QB64 has this or another language I use.
There was a command that allowed

window(x1,y1,x2,y2)
this will make a windows in text/console mode that will act independently including scrolling
window(1,1,40,15)

If not, is there something similar? have an app that would work reall well with such a feature

Thansk!!
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: Does a "window" function exist in console
« Reply #1 on: May 07, 2019, 02:08:59 am »
You may also use $CONSOLE, if all you need is a scrollable text window.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline freetrav

  • Newbie
  • Posts: 45
Re: Does a "window" function exist in console
« Reply #2 on: May 07, 2019, 08:31:11 am »
I recall the command that the OP is asking about; it was not in QB - but it was in BetterBASIC, and I used it very heavily in the days I was using BetterBASIC. I don't think I've encountered it in any other BASICs, but I won't swear to it.

Offline xra7en

  • Seasoned Forum Regular
  • Posts: 284
Re: Does a "window" function exist in console
« Reply #3 on: May 08, 2019, 08:53:36 am »
I recall the command that the OP is asking about; it was not in QB - but it was in BetterBASIC, and I used it very heavily in the days I was using BetterBASIC. I don't think I've encountered it in any other BASICs, but I won't swear to it.

I probably didn't clarify that well.

the console windows 80x25 you can basically divide that into smaller windows that function independently but cumulatively does not exceed the 80-x25 limitation of the console window.
I did find it, it was pascal.
https://www.freepascal.org/docs-html/rtl/crt/window.html
Ilove pascal, however it seems to be the only  console lang, that cannot do full screen. no hacks or anything, until you use it on win10, then you can alt-tab to full screen.

Example: you can have a title bar 2x80 that will remain static, everything else under that will scroll UNDER that 2x80.
I just like re-writing old DOS book games into modern QB64 code - weird hobby, I know!

Offline freetrav

  • Newbie
  • Posts: 45
Re: Does a "window" function exist in console
« Reply #4 on: May 13, 2019, 10:19:44 am »
I probably didn't clarify that well.

the console windows 80x25 you can basically divide that into smaller windows that function independently but cumulatively does not exceed the 80-x25 limitation of the console window.
I did find it, it was pascal.
https://www.freepascal.org/docs-html/rtl/crt/window.html
Ilove pascal, however it seems to be the only  console lang, that cannot do full screen. no hacks or anything, until you use it on win10, then you can alt-tab to full screen.

Example: you can have a title bar 2x80 that will remain static, everything else under that will scroll UNDER that 2x80.

Yes. That's exactly what I recall from BetterBASIC. I also used an operating system called CTOS where this capability was part of the system library, and accessible from all languages implemented on the platform. On CTOS, it was called "frames", and didn't use the WINDOW keyword, but it worked as you described.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
Re: Does a "window" function exist in console
« Reply #5 on: May 14, 2019, 08:43:34 am »
Hi xra7en
in Qbasic and QB64 there is this... with its limits...
http://qb64.org/wiki/VIEW_PRINT

while for graphic mode there is this...
http://qb64.org/wiki/VIEW

the keyword WINDOW is to resetting the cohordinates of a viewport defined by VIEW
see here http://qb64.org/wiki/WINDOW
and to fast convert cohordinate between view port and screen dimensions there is PMAP http://qb64.org/wiki/PMAP

About a indipendent console with scrolling I remember XBASIC that runs in window10 (IMHO)
here links
https://en.wikipedia.org/wiki/XBasic
http://www.xbasic.org
http://gnetools.sourceforge.net/xbsupport/index.html

Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Does a "window" function exist in console
« Reply #6 on: May 14, 2019, 09:07:49 am »
Hi (again :) ) TempodiBasic,

I had found the same things (VIEW, VIEW PRINT and WINDOW) but didn't say anything because it seems they want a scrolling function too.

Steve's suggestion of $CONSOLE came closest but to me not very satisfactory:
1. because there are two windows to deal with and 2. it is not part of the screen but the whole "Window".

It might be fun and not too difficult to build code for scrolling window in graphics screen, Pete can do SCREEN 0. ;-))
When mouse is over a "View Port", a designated section of screen, the MouseWheel might scroll text from an Array / Virtual Window of Text. Such text could be appended or edited, just like an text editor would handle a whole page. Appended text would be easiest AND could act more like a Console window ta boot! with input and output text always coming at the end and adding to the length of the scroll.

Yep, might be a nice challenge. :)

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Does a "window" function exist in console
« Reply #7 on: May 14, 2019, 02:05:09 pm »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • Steve’s QB64 Archive Forum
Re: Does a "window" function exist in console
« Reply #8 on: May 14, 2019, 03:23:37 pm »
Vince has something already started:
https://www.qb64.org/forum/index.php?topic=17.msg1677#msg1677

You can also make use of my frame library; it seems as if it’d do what you want: https://www.qb64.org/forum/index.php?topic=718.0
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Does a "window" function exist in console
« Reply #9 on: May 14, 2019, 04:44:02 pm »
Hi Steve,

A quick search for _MOUSE, _KEY or INKEY reveals no mouse or key functioning. How does Frame Library offer a scrollable window?
« Last Edit: May 14, 2019, 05:02:45 pm by bplus »