@echo off

if not defined DBLDIR call "%SYNERGYDE32%dbl\dblvars32.bat">nul
if exist *.dbo del *.dbo

echo subroutine mysub>sub1.dbl
echo proc>>sub1.dbl
echo xreturn>>sub1.dbl
echo endsubroutine>>sub1.dbl

echo subroutine mysub>sub2.dbl
echo proc>>sub2.dbl
echo xreturn>>sub2.dbl
echo endsubroutine>>sub2.dbl

dbl -od mydbo sub1
dbl -od mydbo sub2

set REDIRECTFILE=rd.txt
if exist %REDIRECTFILE% del %REDIRECTFILE%

echo -c   mylib>%REDIRECTFILE%
echo -rwv mylib mydbo >>%REDIRECTFILE%

echo -c   mylib2>>%REDIRECTFILE%
echo -rwv mylib2 \>>%REDIRECTFILE%
echo mydbo>>%REDIRECTFILE%

echo -rwv mylib \>>%REDIRECTFILE%
echo mylib2.olb>>%REDIRECTFILE%

@echo on
dblibr -T <%REDIRECTFILE%