• Quick basic question - about adding info to a file

    From Ronald Hudson@21:1/5 to All on Mon Aug 28 21:47:16 2023
    Hi Everyone,

    I am looking at my quick reference guide and the basic-plus manual, I can't seem to find a way to append new information to a file.

    Do I have to open the original file and read each line and print them to a new file, then print the info I want to add?

    there is no:
    1000 open "file.txt" for append as file #3
    1010 print #3, n1$
    1020 close #3

    BTW how can I find out if I have basic-plus or basic-plus-2?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johnny Billquist@21:1/5 to Ronald Hudson on Tue Aug 29 15:50:19 2023
    On 2023-08-29 06:47, Ronald Hudson wrote:
    Hi Everyone,

    I am looking at my quick reference guide and the basic-plus manual, I can't seem to find a way to append new information to a file.

    I think you need to use the MODE keyword with an appropriate value.

    Do I have to open the original file and read each line and print them to a new file, then print the info I want to add?

    there is no:
    1000 open "file.txt" for append as file #3
    1010 print #3, n1$
    1020 close #3

    The BASIC+ manual just mentions the MODE keyword, but refers to the
    RSTS/E programming manual for more details. So you need to go and dig in
    there. Bit 1, I think. But test around some, and read the docs...

    For BASIC+2, you say:

    OPEN "file.txt" ACCESS APPEND AS FILE 3

    BTW how can I find out if I have basic-plus or basic-plus-2?

    If you are switching, then it is into BASIC+.

    BASIC+2 you need to run. And it's also easy to tell when it starts:

    .bp2

    PDP-11 BASIC-PLUS-2 V2.7-C

    BASIC2



    Johnny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ronald Hudson@21:1/5 to Johnny Billquist on Tue Aug 29 07:37:07 2023
    On Tuesday, August 29, 2023 at 6:50:21 AM UTC-7, Johnny Billquist wrote:
    On 2023-08-29 06:47, Ronald Hudson wrote:
    Hi Everyone,

    I am looking at my quick reference guide and the basic-plus manual, I can't seem to find a way to append new information to a file.
    I think you need to use the MODE keyword with an appropriate value.
    Do I have to open the original file and read each line and print them to a new file, then print the info I want to add?

    there is no:
    1000 open "file.txt" for append as file #3
    1010 print #3, n1$
    1020 close #3
    The BASIC+ manual just mentions the MODE keyword, but refers to the
    RSTS/E programming manual for more details. So you need to go and dig in there. Bit 1, I think. But test around some, and read the docs...

    For BASIC+2, you say:

    OPEN "file.txt" ACCESS APPEND AS FILE 3
    BTW how can I find out if I have basic-plus or basic-plus-2?
    If you are switching, then it is into BASIC+.

    BP2 complains about that syntax. I will see if I can hunt up a Basic-Plus-2 manual .pdf file.

    BP2 also hated my compound statements: "1000 n=0:l=0:m=5:q=7 "

    But at least I have Basic+2 which is nice.

    BASIC+2 you need to run. And it's also easy to tell when it starts:

    .bp2

    PDP-11 BASIC-PLUS-2 V2.7-C

    BASIC2



    Johnny
    oooh and it has an extensive help system..
    Ron.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johnny Billquist@21:1/5 to Ronald Hudson on Tue Aug 29 19:09:12 2023
    On 2023-08-29 16:37, Ronald Hudson wrote:
    On Tuesday, August 29, 2023 at 6:50:21 AM UTC-7, Johnny Billquist wrote:
    On 2023-08-29 06:47, Ronald Hudson wrote:
    Hi Everyone,

    I am looking at my quick reference guide and the basic-plus manual,
    I can't seem to find a way to append new information to a file.
    I think you need to use the MODE keyword with an appropriate value.
    Do I have to open the original file and read each line and print
    them to a new file, then print the info I want to add?

    there is no:
    1000 open "file.txt" for append as file #3
    1010 print #3, n1$
    1020 close #3
    The BASIC+ manual just mentions the MODE keyword, but refers to the
    RSTS/E programming manual for more details. So you need to go and dig in
    there. Bit 1, I think. But test around some, and read the docs...

    For BASIC+2, you say:

    OPEN "file.txt" ACCESS APPEND AS FILE 3
    BTW how can I find out if I have basic-plus or basic-plus-2?
    If you are switching, then it is into BASIC+.

    BP2 complains about that syntax. I will see if I can hunt up a
    Basic-Plus-2 manual .pdf file.
    You can find that manual too on Mim.

    And yeah, I messed up.

    It should be:

    OPEN "file.txt" AS FILE 3, ACCESS APPEND

    BP2 also hated my compound statements: "1000 n=0:l=0:m=5:q=7 "
    : for separating statements was already deprecated in BASIC+, but still possible. Not allowed anymore in BASIC+2. DEC changed into using
    backslash. So if you do:

    1000 n=0\l=0\1=7

    it should work.

    Also, BASIC+2 do not need line numbers. But for that, you need to edit
    the file outside of the BP2 environment, and load the file. You can also
    have labels where you think they might be useful instead of line numbers...

    But at least I have Basic+2 which is nice.
    Ok. That's good.


    BASIC+2 you need to run. And it's also easy to tell when it starts:

    .bp2

    PDP-11 BASIC-PLUS-2 V2.7-C

    BASIC2



    Johnny
    oooh and it has an extensive help system..
    It does. Oh, and if you want a bit of inspiration:

    http://mim.stupi.net/sources/

    (that's the sources for the web server giving you those pages. All
    written in BASIC+2.)

    Johnny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ronald Hudson@21:1/5 to All on Tue Aug 29 12:48:15 2023
    Hi Johnny and everyone,

    I am looking in on-line help and in the "Basic Plus 2 RSTS/E User's guide" but I don't see how one might do this:

    from a DCL prompt launch BP2 with a basic program in a .B2S file and run the Basic program.

    I can launch BP2 then I have to manually OLD <MYFILE> The .B2S extension seems to be optional, then RUN.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johnny Billquist@21:1/5 to Ronald Hudson on Wed Aug 30 02:24:19 2023
    On 2023-08-29 21:48, Ronald Hudson wrote:
    Hi Johnny and everyone,

    I am looking in on-line help and in the "Basic Plus 2 RSTS/E User's guide" but I don't see how one might do this:

    from a DCL prompt launch BP2 with a basic program in a .B2S file and run the Basic program.

    I can launch BP2 then I have to manually OLD <MYFILE> The .B2S extension seems to be optional, then RUN.

    BASIC+2 is primarily a compiler. You compile your program, and get a
    .OBJ file, which you then link, and then you have an executable.

    See the help for COMPILE and BUILD in BASIC+2.

    With that said, if you want to run something interactively, I would
    think *maybe* this would do it:

    $ BP2
    OLD FOO
    RUN

    But that is a guess from my side. I'm no expert in RSTS/E... I can tell
    you how to do it in RSX, but that won't help you. ;-)

    Johnny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ronald Hudson@21:1/5 to Johnny Billquist on Tue Aug 29 20:35:00 2023
    On Tuesday, August 29, 2023 at 5:24:21 PM UTC-7, Johnny Billquist wrote:
    On 2023-08-29 21:48, Ronald Hudson wrote:
    Hi Johnny and everyone,

    I am looking in on-line help and in the "Basic Plus 2 RSTS/E User's guide" but I don't see how one might do this:

    from a DCL prompt launch BP2 with a basic program in a .B2S file and run the Basic program.

    I can launch BP2 then I have to manually OLD <MYFILE> The .B2S extension seems to be optional, then RUN.
    BASIC+2 is primarily a compiler. You compile your program, and get a
    .OBJ file, which you then link, and then you have an executable.

    See the help for COMPILE and BUILD in BASIC+2.

    With that said, if you want to run something interactively, I would
    think *maybe* this would do it:

    $ BP2
    OLD FOO
    RUN

    But that is a guess from my side. I'm no expert in RSTS/E... I can tell
    you how to do it in RSX, but that won't help you. ;-)

    Johnny
    I was playing with that earlier - the build step looks like TKB, but I could not get the correct incantation to turn my .OBJ into a .TSK -- This is what I want to end up with, right?

    I will try the compile and build commands from within Basic+2.

    Ron.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Johnny Billquist@21:1/5 to Ronald Hudson on Wed Aug 30 10:39:14 2023
    On 2023-08-30 05:35, Ronald Hudson wrote:
    On Tuesday, August 29, 2023 at 5:24:21 PM UTC-7, Johnny Billquist wrote:
    On 2023-08-29 21:48, Ronald Hudson wrote:
    Hi Johnny and everyone,

    I am looking in on-line help and in the "Basic Plus 2 RSTS/E User's guide" but I don't see how one might do this:

    from a DCL prompt launch BP2 with a basic program in a .B2S file and run the Basic program.

    I can launch BP2 then I have to manually OLD <MYFILE> The .B2S extension seems to be optional, then RUN.
    BASIC+2 is primarily a compiler. You compile your program, and get a
    .OBJ file, which you then link, and then you have an executable.

    See the help for COMPILE and BUILD in BASIC+2.

    With that said, if you want to run something interactively, I would
    think *maybe* this would do it:

    $ BP2
    OLD FOO
    RUN

    But that is a guess from my side. I'm no expert in RSTS/E... I can tell
    you how to do it in RSX, but that won't help you. ;-)

    Johnny
    I was playing with that earlier - the build step looks like TKB, but I could not get the correct incantation to turn my .OBJ into a .TSK -- This is what I want to end up with, right?

    I will try the compile and build commands from within Basic+2.

    The BUILD command will create the command file needed for TKB to link
    the file.

    Once you've createed that command file for TKB, you use that.
    In RSX, the command would be

    TKB @file
    (in MCR)

    or

    LINK file/BASIC
    (in DCL)

    Not sure how it might be invoked in RSTS/E...


    The exact settings used for generating that input can be seen if you do
    "SHOW" in BP2.

    Johnny

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ronald Hudson@21:1/5 to Johnny Billquist on Wed Aug 30 13:07:31 2023
    On Wednesday, August 30, 2023 at 1:39:15 AM UTC-7, Johnny Billquist wrote:
    On 2023-08-30 05:35, Ronald Hudson wrote:
    On Tuesday, August 29, 2023 at 5:24:21 PM UTC-7, Johnny Billquist wrote:
    On 2023-08-29 21:48, Ronald Hudson wrote:
    Hi Johnny and everyone,

    I am looking in on-line help and in the "Basic Plus 2 RSTS/E User's guide" but I don't see how one might do this:

    from a DCL prompt launch BP2 with a basic program in a .B2S file and run the Basic program.

    I can launch BP2 then I have to manually OLD <MYFILE> The .B2S extension seems to be optional, then RUN.
    BASIC+2 is primarily a compiler. You compile your program, and get a
    .OBJ file, which you then link, and then you have an executable.

    See the help for COMPILE and BUILD in BASIC+2.

    With that said, if you want to run something interactively, I would
    think *maybe* this would do it:

    $ BP2
    OLD FOO
    RUN

    But that is a guess from my side. I'm no expert in RSTS/E... I can tell >> you how to do it in RSX, but that won't help you. ;-)

    Johnny
    I was playing with that earlier - the build step looks like TKB, but I could not get the correct incantation to turn my .OBJ into a .TSK -- This is what I want to end up with, right?

    I will try the compile and build commands from within Basic+2.
    The BUILD command will create the command file needed for TKB to link
    the file.

    Once you've createed that command file for TKB, you use that.
    In RSX, the command would be

    TKB @file
    (in MCR)

    or

    LINK file/BASIC
    (in DCL)

    Not sure how it might be invoked in RSTS/E...


    The exact settings used for generating that input can be seen if you do "SHOW" in BP2.

    Johnny

    This has it - for the Basic program COLATZ.B2S
    BP2 COLATZ
    LINK COLATZ
    RUN COLATZ

    Will compile link and run the program, leaving the intermediate files in the directory.

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