[Coco] OS/9 Command to gain keyboard control from script

Robert Gault robert.gault at att.net
Wed Apr 1 10:34:54 EDT 2015


Cocodemus wrote:
> No, its when you call a program from a script, it takes the input from the script itself, i want to get input from keyboard itself something like
>
> Minted < /term
>
> Also how to create another window and switch to that from the script? I remember a display sequence for that
>
> Sent from my iPhone

Here is an example of a script I wrote which asks how many text windows I want 
to create and then creates them. It uses a version of the "prompt" command that 
is slightly different from that in the NitrOS-9 project.
The command getnw asks the system for the next uninitialized window. The 
commands shellsub and shellhex take input from the standard path and send it to 
the shell as a shell variable. Shellsub expects $hex values. Shellhex converts 
decimal values to $Hex for commands like display.

script is called 'textw'

* start an 80 column text window in the next available space
* with distinctive border color
prompt2 echo How many windows should I create? ;var.3
*main
if +%3<>00000
dec.3
getnw ! shellsub 0
var.0=%%0; var.1=%%0
*loop
if +%0<>00000
dec.0
inc.1
inc.1
inc.1
goto loop
endif
echo %1! shellhex 1
iniz w%%0; display 1b 20 2 0 0 50 19 2 0 7 1b 31 7 %%1>/w%%0
xmode /w%%0 rpr=9 dup=19 pau=1 pag=19 row=19 bso=1
echo 80col. text /w%%0 started with procs
shell i=/w%%0&
goto main

There is no simple built-in function of NitrOS-9 that does what you want. You 
will have to write ml programs and scripts.

Robert



More information about the Coco mailing list