PowerBuilder – Creating PBG file from exported *.sr* files

Poor man’s PBG Creator form exported sources looks like this:

File: create_pbg.bat
@echo off
@rem %1 like "pfc_main.pbl"
@rem %2 relative path with 2 backslahes "\\" as
@rem path separators ( like "pfc\\pfc_main\\")
@rem pointing from the Workspace root to PBLs directory
@rem current directory must be the directory with the *.sr* files
echo Save Format v3.0(19990112)
echo @begin Libraries
echo "%2%1.pbl" "";
echo @end;
echo @begin Objects
for %%f in (*.sr*) do echo "%2%%f" "%2%1.pbl";
echo @end;

To create PBGs in all subdirectories (non-recursive) you can use:

File: create_pbl_indirectories.bat
@set CURRENTDIR=%CD%
@set PBG_SCRIPT=%CURRENTDIR%\create_pbg.bat

FOR /F „tokens=*“ %%d IN (‚DIR /b /ad‘) do ( cd %%d & ( %PBG_SCRIPT% %%d %%d\\ > %%d.pbg ) & cd %CURRENTDIR%)

Schreibe einen Kommentar