• PRINT #1 TAB(A); ???

    From Walt Perko@21:1/5 to All on Sun Sep 18 20:56:35 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Campbell@21:1/5 to Walt Perko on Mon Sep 19 14:09:02 2022
    Walt Perko <r4rguy@gmail.com> wrote:
    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



    Line 130 needs a comma. Should be:

    130 PRINT #1, TAB(A);

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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bill Gunshannon@21:1/5 to Walt Perko on Mon Sep 19 20:09:59 2022
    On 9/19/22 19:16, Walt Perko wrote:
    On Monday, September 19, 2022 at 7:09:09 AM UTC-7, Bob Campbell wrote:
    Walt Perko <r4r...@gmail.com> wrote:
    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


    Line 130 needs a comma. Should be:

    130 PRINT #1, TAB(A);

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

    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.


    Your program lacks the ; after the PRINT command that suppresses
    the new line.

    bill

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walt Perko@21:1/5 to Bob Campbell on Mon Sep 19 16:16:27 2022
    On Monday, September 19, 2022 at 7:09:09 AM UTC-7, Bob Campbell wrote:
    Walt Perko <r4r...@gmail.com> wrote:
    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


    Line 130 needs a comma. Should be:

    130 PRINT #1, TAB(A);

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

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Campbell@21:1/5 to Walt Perko on Tue Sep 20 00:16:45 2022
    Walt Perko <r4rguy@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Campbell@21:1/5 to Bill Gunshannon on Tue Sep 20 00:31:42 2022
    Bill Gunshannon <bill.gunshannon@gmail.com> wrote:
    On 9/19/22 19:16, Walt Perko wrote:
    On Monday, September 19, 2022 at 7:09:09 AM UTC-7, Bob Campbell wrote:
    Walt Perko <r4r...@gmail.com> wrote:
    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


    Line 130 needs a comma. Should be:

    130 PRINT #1, TAB(A);

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

    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.


    Your program lacks the ; after the PRINT command that suppresses
    the new line.

    bill

    Ah yes. Lines 150 and 180.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walt Perko@21:1/5 to Bob Campbell on Mon Sep 19 19:46:11 2022
    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, " *";
    190 B=0
    200 IF INKEY$<>"" THEN GOTO 999
    250 NEXT T
    998 GOTO 50
    999 END

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Campbell@21:1/5 to Walt Perko on Wed Sep 21 02:40:12 2022
    Walt Perko <r4rguy@gmail.com> wrote:
    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, " *";
    190 B=0
    200 IF INKEY$<>"" THEN GOTO 999
    250 NEXT T
    998 GOTO 50
    999 END

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Campbell@21:1/5 to Bob Campbell on Wed Sep 21 02:42:15 2022
    Bob Campbell <nunya@none.none> wrote:
    Walt Perko <r4rguy@gmail.com> wrote:
    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, " *";
    190 B=0
    200 IF INKEY$<>"" THEN GOTO 999
    250 NEXT T
    998 GOTO 50
    999 END

    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.


    Yeah, I knew the above would not come out correctly. It was a large V originally.

    But you still get the idea.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walt Perko@21:1/5 to Bob Campbell on Tue Sep 20 20:21:17 2022
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bob Campbell@21:1/5 to Walt Perko on Wed Sep 21 03:46:07 2022
    Walt Perko <r4rguy@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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walt Perko@21:1/5 to Bob Campbell on Tue Sep 20 22:26:19 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)