포럼: 公開討議 (Thread #25630)

Too many windows (2010-03-06 14:05 by mt #49205)

I am translating some GWBASIC programs into Decimal BASIC and have found this annoying: The good-old Console is now split into many windows. Graphics goes to a bitmap window, print-out goes to a text window and keyboard-input comes throught an input window. Under a Windows OS environment, it is ease to click on a wrong window (e.g., the text output window) and then lost the focus on input window. Hence, subsequent keyboard-input cannot be read by the program.

To avoid such windows-focusing issue, is it possible to run Decimal-BASIC in a Console (like those of the DOS days)? That is, to both read and print text with the focus on a single window?

Reply to #49205×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Too many windows (2010-03-07 08:42 by SHIRAISHI Kazuo #49226)

Current edtion of Decimal BASIC can not operate on the console.
The main theme of Decimal BASIC was to removing a limitation on the length of text output, which could not be realized with the DOS console.
Decimal BASIC is published accompanied by the source code, so anyone is allowed to supplement a console mode I/O, and more to implement the editing module of ANSI Full BASIC, which is suitable for old-fashioned program editing.

I have a plan to supplement the console I/O with BASICAcc, but not with Decimal BASIC.

To supplement the console I/O with Decimal BASIC, append the functionality of console I/O inheriting 'TTextDevice' class in the Pascal unit 'textfile',
and connect the channel #0 with the console, which can be done by re-writing
the unit 'struct'.
The 'struct' unit holds the function TProgramUnit.channel(ch:integer) , and that have the code

if ch=0 then
channel:=console
else
.

in this code, 'console' does not mean the DOS console, but an instance of TConsole class ,which inherits TTextDevice.

Make the new class that inherits TConsole , and substitutes its instance for 'console' above.

If you intend to change not only #0 but all standard I/O to the console I/O, overwrite the 'console' variable with the instance of the new class that inherits TConsole. The definition of the variable 'console' can be found in the unit 'compiler'.

Reply to #49205

Reply to #49226×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Too many windows (2010-03-07 11:40 by mt #49232)

Thanks Kazuo! I am just a humble BASIC programmer; unable to alter the source code. But running programs on Decimal BASIC with its many windows is indeed difficult.

Consider: A program prints out something for instruction, and then ask me for some input. The print out goes to a text output window, and then an input window pops up, blocking the output text. In order to read the instruction, I much click the output window to bring it on top. But then, I may not return to the input window easily (alt-tab does work). I can minimise the output window in order to see the input window, click on the input window, and then type my input. But then, I must restor the output window to see any further output from the program. . .

A better solution is not to close windows but to do a lot of resize and drag-and drop arrangement, so that windows are tiled; but don't forget to click the proper input window to bring it in focus afterward. That makes using this BASIC difficult and tiresome particularly for a BEGINNER.

Sorry about the rants. But I think Decimal BASIC is perfect except for such inconvenience in running a program.
Reply to #49205

Reply to #49232×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Too many windows (2010-03-07 11:53 by mt #49233)

Mistakes in my previous post (sorry): The input windows are always on top. So they are always visible. To see the output window they have covered, one must do drag-and-drop arrangement. But there is no need to close any output windows in order to get access to input windows.
Reply to #49232

Reply to #49233×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Too many windows (2010-03-07 15:30 by SHIRAISHI Kazuo #49241)

You can use win32 API to control the windows as you like.
But the documents for Win32 API have not translated in English yet.
See
http://hp.vector.co.jp/authors/VA008683/QA_WindowPos.htm

Reply to #49205

Reply to #49241×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: Too many windows (2010-03-07 22:08 by mt #49246)

Thanks for the hint, and I guess I can understand the katakana and kanji. I shall try and see if it works.

PS: But adding Win API elements to a program may defeated the purpose (portability and beauty) of a standard-compliant language. There are other BASIC's that use a console but all of them are not standard-compliant; Make me wonder why there exist language standards; for no one is following them!
Reply to #49205

Reply to #49246×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login