Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PRINT #1 TAB(A); ???

26 views
Skip to first unread message

Walt Perko

unread,
Sep 18, 2022, 11:56:36 PM9/18/22
to
Hi,

TRS-80 Model 100

I'm trying to send the program data out the serial port. The program runs with lines like; 130 PRINT TAB(A);

but fails with 130 PRINT #1 TAB(A);

How to fix the program so data does go out the serial port?

10 OPEN "COM:88NE1" FOR OUTPUT AS 1
50 B=0
100 REM START LONG LOOP
110 FOR T=0 TO 80 STEP .25
120 A=INT(26+25*SIN(T))
130 PRINT #1 TAB(A);
140 IF B=1 THEN 180
150 PRINT #1 " *"
160 B=1
170 GOTO 200
180 PRINT #1 " *"
190 B=0
200 IF INKEY$<>"" THEN GOTO 999
250 NEXT T
998 GOTO 50
999 END

Bob Campbell

unread,
Sep 19, 2022, 10:09:09 AM9/19/22
to
Line 130 needs a comma. Should be:

130 PRINT #1, TAB(A);

Otherwise, that is some ugly BASIC code. :-)



Walt Perko

unread,
Sep 19, 2022, 7:16:28 PM9/19/22
to
Hi,

Okay, adding the comma fixed the one error, but the output isn't actually tabbing out on the display ???

All the "*" are in a vertical line on the left side. They should be doing a series of "sinewaves" on the screen.

Bill Gunshannon

unread,
Sep 19, 2022, 8:10:02 PM9/19/22
to
Your program lacks the ; after the PRINT command that suppresses
the new line.

bill

Bob Campbell

unread,
Sep 19, 2022, 8:16:51 PM9/19/22
to
Walt Perko <r4r...@gmail.com> wrote:
> Hi,
>
> Okay, adding the comma fixed the one error, but the output isn't actually
> tabbing out on the display ???
>
> All the "*" are in a vertical line on the left side. They should be
> doing a series of "sinewaves" on the screen.

What screen are you referring to? What is the serial port connected to?

As far as I recall, you can’t do this when Printing to a file. Print #1,
<whatever> is treated as a data file. There are ways to format the data
records, but TABbing does not work.

If you are sending this to a printer, you could use LPRINT instead of
PRINT, but then it would have to be connected to the parallel port, not the
serial port.



Bob Campbell

unread,
Sep 19, 2022, 8:31:47 PM9/19/22
to
Ah yes. Lines 150 and 180.

Walt Perko

unread,
Sep 19, 2022, 10:46:11 PM9/19/22
to
On Monday, September 19, 2022 at 5:31:47 PM UTC-7, Bob Campbell wrote:

> Ah yes. Lines 150 and 180.


Okay, I fixed line 150 and 180 ... but now the program just prints stars across the screen row after row ???

e.g.,
********************************************************************************
********************************************************************************
********************************************************************************

I'm sending the output to the serial port which is connected to a VersaTerm VT-100 emulator that connects to a VGA/LCD monitor.

When I run the program on my Altair-Duino Pro, on a VersaTerm, or ASCII Terminal or even in TeraTerm on my PC I see a sine wave.


10 OPEN "COM:88NE1" FOR OUTPUT AS 1
20 INPUT "Pause Time";P
40 REM arkable Program by David Ahl and modified by WKP SINEWKP.BAS
50 B=0
100 REM START LONG LOOP
110 FOR T=0 TO 80 STEP .25
120 A=INT(26+25*SIN(T))
130 PRINT #1, TAB(A);
140 IF B=1 THEN 180
145 FOR PAUSE = 0 TO P:NEXT PAUSE
150 PRINT #1, " *";
160 B=1
170 GOTO 200
180 PRINT #1, " *";

Bob Campbell

unread,
Sep 20, 2022, 10:40:16 PM9/20/22
to
This will not work with PRINT #1 going out the serial port. OPEN FOR
OUTPUT AS 1 means you are creating a text file. There is no cursor to
position.

All you can send is plain text. PRINT TAB (A) is for positioning the
cursor on the screen. There is no cursor to position in a text file.

The best you can do is just PRINT #1 formatted lines of text. Like this:

* *
* *
* *
* *
* *
* *
* *
* *
* *
* *

And on and on. To print any pattern you want. Not very elegant, but that
is how all “graphics” were printed out way back when, on computers that had
no graphics capabilities.

The program you are using is designed to run on a screen. Not to create a
text file.





Bob Campbell

unread,
Sep 20, 2022, 10:42:19 PM9/20/22
to
Yeah, I knew the above would not come out correctly. It was a large V
originally.

But you still get the idea.



Walt Perko

unread,
Sep 20, 2022, 11:21:18 PM9/20/22
to
On the Model 100 screen I can see the sine wave moving up the screen as the program runs, on my Altair computer the program does a reasonable sinewave on the terminal screen attached via serial port to the Altair console.

That is why I'm expecting the program to create a sine wave on the terminal screen attached to the serial port of the Model 100.

So the "TAB" feature in Model 100 TRS-80 basic doesn't send a series of spaces like Microsoft BASIC-80?



Bob Campbell

unread,
Sep 20, 2022, 11:46:13 PM9/20/22
to
Walt Perko <r4r...@gmail.com> wrote:
> On Tuesday, September 20, 2022 at 7:42:19 PM UTC-7, Bob Campbell wrote:
>> Bob Campbell <nu...@none.none> wrote:
>>> Walt Perko <r4r...@gmail.com> wrote:
>>>> On Monday, September 19, 2022 at 5:31:47 PM UTC-7, Bob Campbell wrote:
>>>>
>>> The program you are using is designed to run on a screen. Not to create a
>>> text file.
>>>
>> Yeah, I knew the above would not come out correctly. It was a large V
>> originally.
>>
>> But you still get the idea.
>
> On the Model 100 screen I can see the sine wave moving up the screen as
> the program runs, on my Altair computer the program does a reasonable
> sinewave on the terminal screen attached via serial port to the Altair console.
>
> That is why I'm expecting the program to create a sine wave on the
> terminal screen attached to the serial port of the Model 100.
>
> So the "TAB" feature in Model 100 TRS-80 basic doesn't send a series of
> spaces like Microsoft BASIC-80?

Not when going out the serial port using OPEN FOR OUTPUT AS 1. That is a
text file. Again, there is no cursor to position in a text file.

You can try PRINT #1, SPACE$(A);”*”;

SPACE$(X) creates X number of spaces.

Walt Perko

unread,
Sep 21, 2022, 1:26:20 AM9/21/22
to
On Tuesday, September 20, 2022 at 8:46:13 PM UTC-7, Bob Campbell wrote:
> Walt Perko <r4r...@gmail.com> wrote:

> >
> > So the "TAB" feature in Model 100 TRS-80 basic doesn't send a series of
> > spaces like Microsoft BASIC-80?
> Not when going out the serial port using OPEN FOR OUTPUT AS 1. That is a
> text file. Again, there is no cursor to position in a text file.
>
> You can try PRINT #1, SPACE$(A);”*”;
>
> SPACE$(X) creates X number of spaces.


Hi,

Okay, changed just line 130 to SPACE(A) and although it's not giving me a sine wave on the screen, it's making a pattern that might be a 360 column sine wave. It's kind of interesting.



0 new messages