Go to:  Davar site entry | Site contents | Site index | Personal computer | 4DOS | PowerBASIC | Text bottom

PBC  4DOS  Batch  Command

PBC batch command compiles a subprogram (function or routine) and places its object module into PowerBASIC object library MODULE.PBL.  It "knows" and uses two hardcoded important locations:

%DOS%:\PWRBASIC\PBC   PowerBASIC command-line compiler program EXE module.
%DOS%:\PBASIC

Directory with PowerBASIC source subprogram (function or routine) text to be compiled and replaced in MODULE.PBL library of precompiled subprograms (in the same directory).

All compiler and librarian technicalities were hardcoded inside the PBC batch command, so that there is no need to remember any of them or waste time to type them in.  Compiler parameters were most carefully chosen and balanced once, and they could be forgotten thereafter for good.  Librarian interactive annoyances were substituted by generated on-the-fly command file.  The only required parameter is the name of the subprogram (function or routine) that is the source for the object module with the same name.  PBC batch command provides a handy tool for support of the modular design of all PowerBASIC programs presented on this site.

Demo of PBC command operation can be found below the command text.



:  PBC  Compile and Add to Library PowerBASIC SubProgram  01/11/1996-05/24/1997
:  ----------------------------------------------------------------------------
:  Copyright (C) 1996-1997 by Vladimir Veytsel                    www.davar.net

:  1. Name of %DOS%:\PBASIC subprogram (function or routine)
:     to be compiled and added to the MODULE.PBL library
:     "?" - Display PBC.BTM script text (Equivalent:  "/").

@ECHO %TR%

 IF %1.==?. .OR. %1.==/. (LIST %_BATCHNAME ^ CLS ^ QUIT)

 IF NOT EXIST %DOS%:\PBASIC\%1.BAS (ECHO %S%%R%SubProgram %DOS%:\PBASIC\%M%%@UPPER[%1].BAS %R%doesn't exist - %M%PBC %R%cancelled%D% ^ QUIT)

 PUSHD %DOS%:\PBASIC

 %DOS%:\PWRBASIC\PBC %1 /CU /EB-/EN-/EO-/ES- /LB-/LG-/LP-/LS- /OZF

@ECHO:
 INKEY /W5 /K"[Enter]" %W%Hit %C%[Enter] %W%or %Y%wait %W%to continue...%D% %%R
 SET R=
@ECHO:

 ECHO O MODULE >  %1.PBL
 ECHO D %1     >> %1.PBL
 ECHO A %1     >> %1.PBL
 ECHO Q        >> %1.PBL
 %DOS%:\PWRBASIC\PBLIB %1.PBL

 DEL %1.PBU %1.PBL /Q

@ECHO %W%SubProg %DOS%:\PBASIC\%G%%@UPPER[%1].BAS %W%compiled & added to %DOS%:\PBASIC\%G%MODULE.PLB %W%library%D%
 POPD
  


Compile function WEEKDAY and replace (Delete-Add) its object module in the MODULE.PBL library.


   Tue  4/15/02 19:05  C:\> PBC WEEKDAY

   PowerBASIC Compiler Version 3.20   Copyright (c) 1989-1995 by Robert S. Zale
   PowerBASIC Inc. *  Carmel, CA, USA
   C:\PBASIC\WEEKDAY.BAS
   26 statements, 130 lines
   Compile time:  00:00.1 Compilation speed:  78000 lines/minute
   464 bytes code, 2864 bytes data, 2048 bytes stack
   Segments(1):  1k

   Hit [Enter] or wait to continue...

   PBLIB:  PowerBASIC Object/Unit Librarian version #3.20
   PowerLIB:   <none>
   Help, Open, Close, List, Map, Add, Delete, Extract, Quit ? O

   Power Library File Name:  MODULE

   PBLIB:  PowerBASIC Object/Unit Librarian version #3.20
   PowerLIB:   MODULE.PBL
   Help, Open, Close, List, Map, Add, Delete, Extract, Quit ? D

   UNIT/OBJ File Name:  WEEKDAY
   Deleting module WEEKDAY.PBU in library MODULE.PBL

   PBLIB:  PowerBASIC Object/Unit Librarian version #3.20
   PowerLIB:   MODULE.PBL
   Help, Open, Close, List, Map, Add, Delete, Extract, Quit ? A

   UNIT/OBJ File Name:  WEEKDAY
   Adding module WEEKDAY.PBU to library MODULE.PBL

   PBLIB:  PowerBASIC Object/Unit Librarian version #3.20
   PowerLIB:   MODULE.PBL
   Help, Open, Close, List, Map, Add, Delete, Extract, Quit ? Q

   Closing MODULE.PBL

   SubProg C:\PBASIC\WEEKDAY.BAS compiled & added to C:\PBASIC\MODULE.PLB library


View [and save] PBC.BTM text
(Use [Back] button or [Alt]+[CL] to return here from the viewed text)
Copyright © 1996–1997 by
Go to:  Davar site entry | Site contents | Site index | Personal computer | 4DOS | PowerBASIC | Text top