Auto running SBASIC jobs
-
- Aurora
- Posts: 970
- Joined: Tue Dec 17, 2013 1:17 pm
Auto running SBASIC jobs
From within a SBASIC daughter job. I want to start another SBASIC daughter job, which auto runs a BASIC program.
Leaving the original daughter job running.
I am using EXEC program_name_bas to start the new SBASIC program
The problem is it starts with a window (#0) drawn on top
If I press any key to to get the next page, then the window disappears
And does not reappear again, unless I BREAK into the program.
Can I start the SBASIC daughter job without the #0 window appearing?
I have looked at the SMSQ/E manual, But it's not very clear, It talks about this window, but does not mention how to suppress it.
Leaving the original daughter job running.
I am using EXEC program_name_bas to start the new SBASIC program
The problem is it starts with a window (#0) drawn on top
If I press any key to to get the next page, then the window disappears
And does not reappear again, unless I BREAK into the program.
Can I start the SBASIC daughter job without the #0 window appearing?
I have looked at the SMSQ/E manual, But it's not very clear, It talks about this window, but does not mention how to suppress it.
Re: Auto running SBASIC jobs
SBASIC operation is quite complex. Briefly, however, depending on how you start up an SBASIC daughter job, unless you explicitly open the three default channels, any IO sent to one of those channels causes channel #0 to be opened and the IO to be directed there. Thus PRINT or PAUSE without an explicit channel number will cause the channel #0 window to appear, as shown in your first illustration.
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Re: Auto running SBASIC jobs
BTW, instead of EXEC you could use EXEP "SBASIC"; "lrun 'my_default_program_bas'"
Anything you put on the command line gets fed directly to the command channel #0

Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
-
- Aurora
- Posts: 970
- Joined: Tue Dec 17, 2013 1:17 pm
Re: Auto running SBASIC jobs
Here's the start of the programpjw wrote:SBASIC operation is quite complex. Briefly, however, depending on how you start up an SBASIC daughter job, unless you explicitly open the three default channels, any IO sent to one of those channels causes channel #0 to be opened and the IO to be directed there. Thus PRINT or PAUSE without an explicit channel number will cause the channel #0 window to appear, as shown in your first illustration.
Code: Select all
10 DIM var87C4$(1) : OPEN #1,"con_448x200a32x16" : PAPER #1,0 : INK #1,7 : BORDER 1,7 : CLS : CSIZE #1,2,0
20 INK #1,2 : AT #1,0,10 : PRINT#1,"Compact draw help"\\ : INK #1,7
30 PRINT#1,"Alter : modify a picture file on"\" microdrive"\\"Box : Draw a box between the"\" two cursors."\\
40 PRINT#1;"Circle : Draw a circle or ellipse."\" Choose the excentricity"\" with ¾ & ¿ ,the angle"\" with ¼ & ½ and the size with < & >"\\
50 PRINT#1;"Dir : Give the microdrive direc-"\" tory ."\" Scroll with space."\\
60 INK #1,4 : PRINT#1;"ESC to return,any other key for help." : INK #1,7
70 var87C4$ = INKEY$(-1 ) : IF (CODE(var87C4$) = 27) THEN QUIT : END IF
80 AT #1,1,0 : CLS 2
90 PRINT#1,"(End)Fill: Fill a closed shape. "\\"Grid : Draw a grid"\\
100 PRINT#1;"Half : Draw a circle arc . Choose curve with ¾ & ¿"\\"Ink : Choose INK on the palette."\\
110 PRINT#1;"Kill : Delete a picture file."\\
120 PRINT#1;"Load : Load a picture file."\\"Mistake : Delete last instruction."\\"New : Use this to change the I/O device drive number."
.
.
.
Which fits, as the screen is drawn before the window appears, which I thought was a bit odd.
-
- Aurora
- Posts: 970
- Joined: Tue Dec 17, 2013 1:17 pm
Re: Auto running SBASIC jobs
Using this method can you still send a string to the CMD$ variable.pjw wrote:BTW, instead of EXEC you could use EXEP "SBASIC"; "lrun 'my_default_program_bas'"Anything you put on the command line gets fed directly to the command channel #0
Or would you have to do something like EXEP "SBASIC"; "cmd$='whatever' : lrun 'my_default_program_bas'"
I don't need it for this particular program, but I might want it in another part of the project.
Re: Auto running SBASIC jobs
Martin,
yes, I guess it's line 70. Even if it isn't explicitly mentioned in the manual, INKEY$ without a channel defaults to #0, so SBASIC seems urged to open that window.
SImply change line 70 to read
Tobias
yes, I guess it's line 70. Even if it isn't explicitly mentioned in the manual, INKEY$ without a channel defaults to #0, so SBASIC seems urged to open that window.
SImply change line 70 to read
Code: Select all
70 var87C4$ = INKEY$(#1,-1 ) : IF (CODE(var87C4$) = 27) THEN QUIT : END IF
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: Auto running SBASIC jobs
Yup, thats the one.Martin_Head wrote:<>
Or would you have to do something like EXEP "SBASIC"; "cmd$='whatever' : lrun 'my_default_program_bas'"
tofro's suggestion that INKEY$ is the offending command is correct. However, you should look at BORDER, CLS (line 10) etc too..
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Re: Auto running SBASIC jobs
If you find it too much trouble to specify channel numbers, you might consider the following "trick":
Code: Select all
100 c0 = FOPEN(#0; 'con')
110 c1 = FOPEN(#1; 'con')
120 c2 = FOPEN(#2; 'con')
130 :
140 INK 7: CLS
150 LIST
160 AT 10, 0:PRINT 'This is a test'
170 PAUSE
180 QUIT
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Re: Auto running SBASIC jobs
I got distracted before finishing my point.
EXEC or EXEP the program above.
Now REM out lines 110 and 120 and try it again.
EXEC or EXEP the program above.
Now REM out lines 110 and 120 and try it again.
Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
-
- Aurora
- Posts: 970
- Joined: Tue Dec 17, 2013 1:17 pm
Re: Auto running SBASIC jobs
Thanks for the help, I just changed all the INKEY$ commands, and that seems to have sorted it out.