Re: [Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-16 Thread gdgqler

On 15 Jul 2011, at 20:38, Martyn Hill wrote:

 
 (Thanks to George as well - extending the Turbo commands would be another 
 solution.)

Really COMMAND_LINE does need updating to take account of daughter BASICs. 
Perhaps the ID of an SBASIC channel could be allowed as an optional parameter. 
Watch this space.

George
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-15 Thread Martyn Hill

On 14/07/2011 20:05, ql-users-requ...@lists.q-v-d.com wrote:

On 13/07/2011 18:16, pjwitte wrote:

  On 13/07/2011 17:48, pjwitte wrote:

  On 13/07/2011 14:10, Martyn Hill wrote:

  Hi everyone

  Something got lost in translation.. Heres a tidier version

  Per

  SBslave

More than somethink got lost in translation! Typically Gremlins snuck
in and added a supernumerous '1024' to line 260, making the program
unusable. Apologies to anyone who wasted time over it! Alter the
offending line from

260 cm$ = 'lrun '  pip$  'o_1024'

to

260 cm$ = 'lrun '  pip$  'o'

and all should be well. Provided: I should also have added a short
note on the environmental assumptions made here. This program was
built up using trial and error until the desired effect was achived -
and then filed away for ten years.

1. As it stands its SMSQ/E (3.13+) only. Sorry. A similar method
should be possible in Minerva too, I guess.
2. It expects to run in a three-windowed SBASIC daughter job

Have a nice day!

Per


--

Thanks very much Per!

I never thought to re-open #0 of the daughter SB job as a pipe - genius!

(Thanks to George as well - extending the Turbo commands would be 
another solution.)


Regards,
Martyn.

--
There are 10 types of people in this world. Those who understand binary and those 
who don't.

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


[Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-13 Thread Martyn Hill

Hi everyone

As part of an on-going SB Editor project in QPC/SMSQ-E, I am reseraching 
ways to queue SB commands in to a daughter SB job.


Extensions such as SG's QUEUE% or Turbo's TYPE_IN don't quite work for 
this purpose as I need to queue the commands from another SB (eventualy 
Turbo'd) job rather than into the current keyboard queue (as pointed to 
by SYS_CKYQ - QUEUE% - or into the the #0 of the current job - TYPE_IN).


So far, I've found no explicit documentation on where to find the 
type-ahead buffer in SMSQ/E CON channels (only the SCR defintion block's 
are described in detail), but my own digging around shows that the 
(serial queue) buffer appears to sit at offset 152dec. ($98) from the 
start of a CON defintion block (after all the SCR-like variables).


So, my question, what is the offical/safest/most portable way to queue 
text in to a given CON (#0 for daughter SB) channel belonging to another 
job?


Thanks for any ideas/alternatives.

Martyn,
London.

--
There are 10 types of people in this world. Those who understand binary and those 
who don't.

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-13 Thread gdgqler

On 13 Jul 2011, at 13:10, Martyn Hill wrote:

 
 As part of an on-going SB Editor project in QPC/SMSQ-E, I am reseraching ways 
 to queue SB commands in to a daughter SB job.
 
 Extensions such as SG's QUEUE% or Turbo's TYPE_IN don't quite work for this 
 purpose as I need to queue the commands from another SB (eventualy Turbo'd) 
 job rather than into the current keyboard queue (as pointed to by SYS_CKYQ - 
 QUEUE% - or into the the #0 of the current job - TYPE_IN).
 
 So far, I've found no explicit documentation on where to find the type-ahead 
 buffer in SMSQ/E CON channels (only the SCR defintion block's are described 
 in detail), but my own digging around shows that the (serial queue) buffer 
 appears to sit at offset 152dec. ($98) from the start of a CON defintion 
 block (after all the SCR-like variables).
 
 So, my question, what is the offical/safest/most portable way to queue text 
 in to a given CON (#0 for daughter SB) channel belonging to another job?
 
 Thanks for any ideas/alternatives.

It looks as though TURBO's COMMAND_LINE should be extended to allow the option 
of picking a daughter basic. If that worked, TYP_IN should work too.

George
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-13 Thread pjwitte

On 13/07/2011 14:10, Martyn Hill wrote:

Hi everyone

As part of an on-going SB Editor project in QPC/SMSQ-E, I am 
reseraching ways to queue SB commands in to a daughter SB job.


Extensions such as SG's QUEUE% or Turbo's TYPE_IN don't quite work 
for this purpose as I need to queue the commands from another SB 
(eventualy Turbo'd) job rather than into the current keyboard queue 
(as pointed to by SYS_CKYQ - QUEUE% - or into the the #0 of the 
current job - TYPE_IN).


So far, I've found no explicit documentation on where to find the 
type-ahead buffer in SMSQ/E CON channels (only the SCR defintion 
block's are described in detail), but my own digging around shows 
that the (serial queue) buffer appears to sit at offset 152dec. 
($98) from the start of a CON defintion block (after all the 
SCR-like variables).


So, my question, what is the offical/safest/most portable way to 
queue text in to a given CON (#0 for daughter SB) channel belonging 
to another job?


Thanks for any ideas/alternatives.

Martyn,
London.

You might be able to do something with the method demonstrated below 
instead:


100  REMarkGet an SBASIC job to work as
110  REMarka slave of another SBASIC.
120  REMarkFull programmable interpreter
130  REMarkvia PRINT statements!
140  REMarkBy pjwitte January 23rd 2001
150  :
160  REMarkInit
170  ch  =1:cu  =0:CLS#ch:CLS#cu
180  pip$  = 'pipe_p'  HEX$(DATE,32)
190  :
200  JOB_NAME  'Master'
210  :
220  REMarkPlumb in SBAS slave
230  co  =FOPEN(pip$'o_2048')
240  ERT  co
250  REMarklrun our command stream
260  cm$  = 'lrun '  pip$'o_1024'
270  REMarkStart SBAS with command
280  EXEP  'SBASIC';  cm$
290  REMarkWe control command channel
300  PRINT#co;  'ch = fopen(#0;'  pip$'i_64)'
310  PRINT#co;  'JOB_NAME Slave'
320  REMarkMessages come out here
330  ci  =FOP_IN(pip$'i'): IFci0:CLOSE
340  ERT  ci
350  :
360  REMarkGive slave some tools
370  LIST#co;  1000  TO
380  :
390  REMarkTest
400  PRINT#co;  'echo Hello: beep 2000, 2'
410  IFAnswer0:CLOSE:STOP
420  :
430  REMarkTorment!
440  CLS#cu:PRINT#cu;  'Type in your commands'
450  REPeatsb
460   INPUT#cu;  ''!  cm$
470   IFcm$  = '' ORcm$  == 'quit': EXITsb
480   PRINT#co;  cm$
490   IFAnswer0: EXITsb
500  END REPeatsb
510  PRINT#co;  'beep 2000, 2: quit'
520  CLOSE
530  :
540  DEFine FuNction  Answer
550  ans%  =0
560  REPeatil
570   k$  =INKEY$(#ci;  20)
580   IFLEN(k$) =0: EXITil
590   INPUT#ci;  l$:echo  k$l$
600ans%  =1
610  END REPeatil
620  IFEOF(#ci):ans%  = -10
630  IFans%  =0:echo  'no answer'
640  IFans%0:echo  'Slave died'
650  RETurnans%
660  END DEFine
670  :
1000  DEFine PROCedure  echo(t$)
1010  PRINT#ch;  t$
1020  END DEFine
1030  :

Per

___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-13 Thread pjwitte

On 13/07/2011 17:48, pjwitte wrote:

On 13/07/2011 14:10, Martyn Hill wrote:

Hi everyone

Something got lost in translation.. Heres a tidier version

Per

SBslave

100 REMark Get an SBASIC job to work as
110 REMark a slave of another SBASIC.
120 REMark Full programmable interpreter
130 REMark via PRINT statements!
140 REMark By pjwitte January 23rd 2001
150 :
160 REMark Init
170 ch = 1: cu = 0: CLS#ch: CLS#cu
180 pip$ = 'pipe_p'  HEX$(DATE,32)
190 :
200 JOB_NAME 'Master'
210 :
220 REMark Plumb in SBAS slave
230 co = FOPEN(pip$  'o_2048')
240 ERT co
250 REMark lrun our command stream
260 cm$ = 'lrun '  pip$  'o_1024'
270 REMark Start SBAS with command
280 EXEP 'SBASIC'; cm$
290 REMark We control command channel
300 PRINT#co; 'ch = fopen(#0;'  pip$  'i_64)'
310 PRINT#co; 'JOB_NAME Slave'
320 REMark Messages come out here
330 ci = FOP_IN(pip$  'i'): IF ci  0: CLOSE
340 ERT ci
350 :
360 REMark Give slave some tools
370 LIST#co; 1000 TO
380 :
390 REMark Test
400 PRINT#co; 'echo Hello: beep 2000, 2'
410 IF Answer  0: CLOSE: STOP
420 :
430 REMark Torment!
440 CLS#cu: PRINT#cu; 'Type in your commands'
450 REPeat sb
460  INPUT#cu; ''! cm$
470  IF cm$ = '' OR cm$ == 'quit': EXIT sb
480  PRINT#co; cm$
490  IF Answer  0: EXIT sb
500 END REPeat sb
510 PRINT#co; 'beep 2000, 2: quit'
520 CLOSE
530 :
540 DEFine FuNction  Answer
550 ans% = 0
560 REPeat il
570  k$ = INKEY$(#ci; 20)
580  IF LEN(k$) = 0: EXIT il
590  INPUT#ci; l$: echo k$  l$
600   ans% = 1
610 END REPeat il
620 IF EOF(#ci): ans% = -10
630 IF ans% = 0: echo 'no answer'
640 IF ans%  0: echo 'Slave died'
650 RETurn ans%
660 END DEFine
670 :
1000 DEFine PROCedure  echo(t$)
1010 PRINT#ch; t$
1020 END DEFine
1030 :
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


Re: [Ql-Users] What's the official method to queue text in to another job's CON channel?

2011-07-13 Thread pjwitte

On 13/07/2011 18:16, pjwitte wrote:

On 13/07/2011 17:48, pjwitte wrote:

On 13/07/2011 14:10, Martyn Hill wrote:

Hi everyone

Something got lost in translation.. Heres a tidier version

Per

SBslave
More than somethink got lost in translation! Typically Gremlins snuck 
in and added a supernumerous '1024' to line 260, making the program 
unusable. Apologies to anyone who wasted time over it! Alter the 
offending line from


260 cm$ = 'lrun '  pip$  'o_1024'

to

260 cm$ = 'lrun '  pip$  'o'

and all should be well. Provided: I should also have added a short 
note on the environmental assumptions made here. This program was 
built up using trial and error until the desired effect was achived - 
and then filed away for ten years.


1. As it stands its SMSQ/E (3.13+) only. Sorry. A similar method 
should be possible in Minerva too, I guess.

2. It expects to run in a three-windowed SBASIC daughter job

Have a nice day!

Per
___
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm