Announcement

Collapse
No announcement yet.

PBLIB does not allow batch jobs via SHELL?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PBLIB does not allow batch jobs via SHELL?

    I have been trying for the past hour to get PBLIB to create my
    custom PBL via a batch job file. *IF* the calling program
    (tried both a 32-bit program and a 16-bit program) first creates
    a BAT file, and SHELL's to THAT, it then works. But, it does NOT
    work if directly calling PBLIB via SHELL, with the batch job
    file passed as a command line argument.

    Is this by design? If not, how would I do it with a direct call
    with SHELL? It's not critical, I guess, since it DOES work if
    the SHELL statement calls the BAT file.


    ------------------
    Clay C. Clear
    mailto:[email protected][email protected]</A>

  • #2
    Please show examples, so we can be sure what you're doing.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      I don't understand what your problem is. When I wrote the Power QPro Pak for
      PowerBASIC, I used a batch file to build the hundreds of items that made
      the library with no problems.
      What I did was use a text file with all the commands in it and
      then re-direct it in the batch file:

      pblib <pro.rsp

      Pro.rsp contained every command for starting the lib, then
      bringing in the indivual files.
      The start of the pro.rsp, for instance, looks like this:
      Code:
      oPRO
      aSOURCE\ADDINT.OBJ
      aSOURCE\ADDUSI.OBJ
      aSOURCE\ALTKEY.OBJ
      aSOURCE\AMENU.OBJ
      aSOURCE\AMENUT.OBJ
      aSOURCE\APRINT.OBJ
      aSOURCE\APRINT0.OBJ
      aSOURCE\APRINTT.OBJ
      aSOURCE\APRINTT0.OBJ
      aSOURCE\ARRAYSIZ.OBJ
      The batch file for this one was:
      Code:
      @Echo Off
      Echo                      *********************************
      Echo                      *            BLDQP              *
      Echo                      *                               *
      Echo                      *   Build library utility for   *
      Echo                      *   QuickPak Professional for   *
      Echo                      *          PowerBASIC           *
      Echo                      *                               *
      Echo                      *                               *
      Echo                      *     Building the library      *
      Echo                      *           PRO.PBL             *
      Echo                      *********************************
      
      IF NOT EXIST PRO.PBL GOTO 1
      DEL pro.pbl
      :1
      IF NOT EXIST %1PBLIB.EXE GOTO ERR1
      %1pblib <nuldat.dat >nul
      IF ERRORLEVEL 1 GOTO ERR
      IF NOT EXIST PRO.RSP GOTO ERR
      %1pblib <pro.rsp
      GOTO END
      :ERR
      @ECHO Unable to locate pro.rsp
      GOTO END
      :ERR1
      @ECHO Unable to find PBLIB.EXE which must reside in the path or have
      @ECHO its location passed as a parameter:
      @ECHO           BLDQP c:\PB\
      @ECHO Note the trailing "\" which is necessary.
      :END
      ------------------
      Barry

      Comment


      • #4
        OK, here's some pseudocode of what I tried (I already scrapped
        the nonproductive code, so, gotta rebuild it for these samples):

        Code:
        'Assume dynamic string array X$() is already populated with the names
        'of the PBU files - the elements do NOT contain the fully qualified
        'paths = they only contain the filenames)
        '
        IF DIR$("c:\pb35\pbu\always.pbl") <> "" THEN
            KILL "c:\pb35\pbu\always.pbl"
        END IF
        '
        FF& = FREEFILE
        OPEN "c:\pb35\pbu\always.rsp" FOR OUTPUT AS #FF&
        PRINT #FF&, "oALWAYS"
        FOR L& = LBOUND(X$) TO UBOUND(X$)
            PRINT #FF&, "a" + X$(L&)
        NEXT
        PRINT #FF&, "q"
        CLOSE FF&
        '
        SetCurrentDirectory "c:\pb35\pbu"
        '
        SHELL "pblib.exe <always.rsp"
        'The above code is for the 32-bit program - the DOS version does the
        'same thing, except it uses integers instead of longs, and uses
        'CHDIR instead of SetCurrentDirectory
        '
        'The above code causes PBLIB to run in "normal" mode, i.e., when
        'you manually delete/add PBU's or OBJ's
        '
        'Given the following BAT file:
        '
        '@echo off
        'cd\pb35\pbu
        'pblib.exe <always.rsp
        '
        'and replacing the above SHELL statement with:
        '
        'SHELL ENVIRON$("COMSPEC") + " z.bat"
        '
        'PBLIB then works correctly in batch mode
        Any ideas?



        ------------------
        Clay C. Clear
        mailto:[email protected][email protected]</A>

        Comment


        • #5
          I think Barry clued me in! The statement in my program:

          SHELL "pblib.exe <always.rsp"

          was actually a command to redirect the RSP file. (been so long
          since I've used DOS redirecting, I forgot all about what the
          "<" and ">" are for )

          OK, got more experimenting to do!

          Thanks, Barry!


          ------------------
          Clay C. Clear
          mailto:[email protected][email protected]</A>

          Comment


          • #6
            I owe ya one, Barry! ('though, if it helps, I am a licensed user
            of QPakPro 1.30. That's where I got the notion of how to
            use PBLIB in batch mode ).

            All I had to do was change it from:

            SHELL "pblib.exe <always.rsp"

            to:

            SHELL "pblib.exe always.rsp"

            Thanks, y'all! Problem solved!


            ------------------
            Clay C. Clear
            mailto:[email protected][email protected]</A>

            Comment

            Working...
            X