Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Compiling and cataloguing multiple BASIC+ source records in batch mode

I am converting around 1000 RBASIC (RevG2B) programs to BASIC+ OI 9.x.

I've worked to get the RBASIC code into a form which ought to be compatible with BASIC+ (e.g. replace all direct calls to the screen like PRINT @ with our own API, put an abstraction layer for printing, etc.)

Now, in order to transfer the refactored RBASIC source into OI and BASIC+, what I've been doing is a manual process:
  1. 1. In REVG, take all the source RBASIC records and OSWRITE them to files R00001.TXT, R00002.TXT, etc. in a specified directory.
  2. 2. OSWRITE an R0000.txt index table, mapping the long names of RBASIC source records with the aforementioned RXXXX.TXT files.
  3. 3. In OI, use the editor to open e.g. file R00001.txt as an OS file, select all, Ctrl-C, Ctrl-V into a newly created empty source record, press F9 to compile, go to next.

What I'd prefer to do with the source files RXXXX.txt is:
  1. 1. read all the source files from the directory one at a time with OSREAD,
  2. 2. turn each of them into records
  3. 3. write each record to a temporary OI table PHS.SOURCE with the proper name
  4. 4. Read these in batch one at a time and compile them as sysprocs,
  5. 5. get a list of the ones which failed

What I can't figure out is how to have the routines be catalogued.

Routines such as REPOSITORY("COMPILE"), REPOSITORY("TCOMPILE"), Recompile_Proc, etc. all assume the procedures are already in SYSPROCS, if I am reading the documentation right.

So I looked at RTP5, which compiles anything you give it whether it is in SYSPROCS or not. It returns object code, but I don't think I can just write the output of RTP5 to SYSPROCS and have it be a catalogued routine, correct?

If the only way around this is to do the "manual macro" of "read, copy, paste, F9, repeat", then I'll do it; but I have to believe there's a better way. :-)

Comments

  • Sorry for the duplicated list numbers. The numbers weren't showing up in the preview, so I typed them in manually - and now they're there twice...!
  • Use the Repository("NEW") message to create the source code in the SYSPROCS table and then follow-up with a Repository ("COMPILE") message.
  • Thanks!

    How should the record/variable containing the source code be delimited: @TM, @FM?

    I can't seem to find this information in the OI documentation for COMPILE anywhere.
  • edited December 2021
    @fm
Sign In or Register to comment.