ECHO OFF
IF NOT %1.==. SET PDL=%1
IF %1.==. PDLWHAT s 'Enter program-by-number directory name.'
IF %PDL%.==. GOTO  EXIT
echo program by the number - PDL menu facility now editing %pdl% %2
SET MENU=%pdl%
SET CD=\%pdl%
IF NOT %2.==. SET CD=%2
IF EXIST %CD%\%MENU%.BY# GOTO gomenu
if exist %cd%\*.*	 goto gomenu
\pdl\pdlask Create new directory %cd% ? (01  ) 1=YES
IF ERRORLEVEL 2 GOTO END
IF ERRORLEVEL 1 goto UPDATE
goto end

:update
echo Creating directory %cd%
IF NOT EXIST %CD%\*.* MD %CD%
:gomenu
CALL \pdl\pdledit %CD%\%MENU%.BY#,free
CLS
TYPE \PDL\PDLLOGO.BAT
ECHO Menu-%MENU%, Library-%CD%
\PDL\PDLASK Option: 1-Compile Menu %MENU%, library %CD%? (01  ) 1=YES
if errorlevel 2 goto end
if errorlevel 1 \pdl\pdlcmda %MENU% %CD%
:end
call 0
