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

PBCL  4DOS  Batch  Command

PBCL batch command compiles a procedure (external program executable from the command prompt), links to it necessary internal precompiled object modules and creates program's EXE module.  It "knows" and uses two hardcoded important locations:

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

Directory with PowerBASIC source procedure; resultant EXE module gets placed in the same directory.

All compiler technicalities were hardcoded inside the PBCL 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.  The only required parameter is the name of the procedure that is the source for the EXE module with the same name.

Non-empty second parameter causes conversion of the resultant EXE module into compressed self-extracting EXE file using LZEXE (Fabrice Bellard, 1989).  Average compression ratio is usually slightly over 25%.  This feature is the legacy of the old days of small hard drives and is not so important now, but once it's there I don't feel compelled to remove it.

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



:  PBCL  Compile and Link into EXE PowerBASIC Procedure  01/11/1996-06/21/1997
:  ---------------------------------------------------------------------------
:  Copyright (C) 1996-1997 by Vladimir Veytsel                   www.davar.net

:  1. Name of %DOS%:\PBASIC procedure to be compiled into EXE file
:     "?" - Display PBCL.BTM script text (Equivalent:  "/").
:  2. When non-empty compress EXE using LZEXE.

@ECHO %TR%

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

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

 PUSHD %DOS%:\PBASIC

 %DOS%:\PWRBASIC\PBC %1 /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:

 IF NOT %2.==. (LZEXE %1 ^ DEL %1.OLD /Q)

@ECHO %W%Procedure %DOS%:\PBASIC\%G%%@UPPER[%1].BAS %W%compiled and linked into %DOS%:\PBASIC\%G%%@UPPER[%1].EXE%D%
 POPD
  


Compile procedure RENPHOT and link it into EXE module.


   Tue  4/16/02 18:24  C:\> PBCL RENPHOT

   PowerBASIC Compiler Version 3.20   Copyright (c) 1989-1995 by Robert S. Zale
   PowerBASIC Inc. *  Carmel, CA, USA
   C:\PBASIC\RENPHOT.BAS
   263 statements, 1049 lines
   Compile time:  00:00.2 Compilation speed:  314400 lines/minute
   5856 bytes code, 3056 bytes data, 2048 bytes stack
   Segments(2):  3k/4k

   Hit [Enter] or wait to continue...

   Procedure C:\PBASIC\RENPHOT.BAS compiled and linked into C:\PBASIC\RENPHOT.EXE


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