-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix looping bat files and add support for non-default file extensions #591
base: main
Are you sure you want to change the base?
Changes from all commits
6044def
034fc5e
bce36b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,23 @@ if /I "%1" == "tron" (set z_TraceMode=tron | |
set /A z_NestLevel=%z_NestLevel%+1 | ||
rem ----- Lvl(%z_NestLevel%) Start %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 | ||
|
||
if /I %1. == . (set /P z_file=Hit Enter for help or suppply name of cbl file to compile: | ||
if /I %1. == . (set /P z_file=Hit Enter for help or supply name of cbl file to compile: | ||
) else (set z_file=%1) | ||
if /I %z_file%. == . goto help | ||
:chkfile | ||
rem convert Unix path notation to Windows before checking the file | ||
set z_file=%z_file:/=\% | ||
if exist %z_file%.CBL goto file_ok | ||
rem if user specified valid extension, strip it off | ||
if /I %z_file:~-4%. NEQ .CBL. goto help | ||
set z_file=%z_file:~0,-4% | ||
if exist %z_file%.CBL goto file_ok | ||
echo %0 ERROR: %z_file%.CBL was not found | ||
set z_ReturnCode=16 | ||
goto return | ||
call bat\fparts.bat %z_TraceMode% %z_file% | ||
set z_file=%z_fdrv%%z_fpath%%z_fname% | ||
if exist %z_file%%z_fext% goto file_ok | ||
rem if extension specified: error because no default applies | ||
if /I %z_fext%. NEQ . goto notfound | ||
rem try with default extension of cbl | ||
set z_fext=.cbl | ||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 25-26. cbl should be CBL. |
||
if exist %z_file%%z_fext% goto file_ok | ||
:notfound | ||
echo Error: Source file %z_file%%z_fext% does not exist | ||
goto retry | ||
|
||
:file_ok | ||
if exist %z_file%.MLC erase %z_file%.MLC | ||
|
@@ -44,7 +47,7 @@ rem get the z390 directory | |
set "z_HomeDir=%~dps0..\" | ||
for %%f in ("%z_HomeDir%") do set "z_HomeDir=%%~ff" | ||
|
||
call %~dps0ZC390 %z_TraceMode% %z_file% %2 %3 %4 %5 %6 %7 %8 %9 | ||
call %~dps0ZC390 %z_TraceMode% %z_file%%z_fext% %2 %3 %4 %5 %6 %7 %8 %9 | ||
set z_ReturnCode=%ERRORLEVEL% | ||
rem any error or warning message has been issued by zc390 | ||
if %z_ReturnCode% NEQ 0 (if %z_ReturnCode% NEQ 4 (erase %z_file%.MLC | ||
|
@@ -64,7 +67,9 @@ exit /b %z_ReturnCode% | |
echo . | ||
echo the CBLC.BAT procedure is intended to compile a single cobol program | ||
echo . | ||
set /P z_file=Hit Enter for more help or suppply name of cbl file to compile: | ||
:retry | ||
set z_file= | ||
set /P z_file=Hit Enter for more help or supply name of cbl file to compile: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cbl should be CBL. |
||
if /I %z_file%. NEQ . goto chkfile | ||
|
||
call %~dps0help %z_TraceMode% | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,23 @@ if /I "%1" == "tron" (set z_TraceMode=tron | |
set /A z_NestLevel=%z_NestLevel%+1 | ||
rem ----- Lvl(%z_NestLevel%) Start %0 %1 %2 %3 %4 %5 %6 %7 %8 %9 | ||
|
||
if /I %1. == . (set /P z_file=Hit Enter for help or suppply name of cbl file to compile and link: | ||
if /I %1. == . (set /P z_file=Hit Enter for help or supply name of cbl file to compile and link: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cbl should be CBL. |
||
) else (set z_file=%1) | ||
if /I %z_file%. == . goto help | ||
:chkfile | ||
rem convert Unix path notation to Windows before checking the file | ||
set z_file=%z_file:/=\% | ||
if exist %z_file%.CBL goto file_ok | ||
rem if user specified valid extension, strip it off | ||
if /I %z_file:~-4%. NEQ .CBL. goto help | ||
set z_file=%z_file:~0,-4% | ||
if exist %z_file%.CBL goto file_ok | ||
echo %0 ERROR: %z_file%.CBL was not found | ||
set z_ReturnCode=16 | ||
goto return | ||
call bat\fparts.bat %z_TraceMode% %z_file% | ||
set z_file=%z_fdrv%%z_fpath%%z_fname% | ||
if exist %z_file%%z_fext% goto file_ok | ||
rem if extension specified: error because no default applies | ||
if /I %z_fext%. NEQ . goto notfound | ||
rem try with default extension of cbl | ||
set z_fext=.cbl | ||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 25-26. cbl should be CBL. |
||
if exist %z_file%%z_fext% goto file_ok | ||
:notfound | ||
echo Error: Source file %z_file%%z_fext% does not exist | ||
goto retry | ||
|
||
:file_ok | ||
if exist %z_file%.MLC erase %z_file%.MLC | ||
|
@@ -44,7 +47,7 @@ rem get the z390 directory | |
set "z_HomeDir=%~dps0..\" | ||
for %%f in ("%z_HomeDir%") do set "z_HomeDir=%%~ff" | ||
|
||
call %~dps0ZC390 %z_TraceMode% %z_file% %2 %3 %4 %5 %6 %7 %8 %9 | ||
call %~dps0ZC390 %z_TraceMode% %z_file%%z_fext% %2 %3 %4 %5 %6 %7 %8 %9 | ||
set z_ReturnCode=%ERRORLEVEL% | ||
rem any error or warning message has been issued by zc390 | ||
if %z_ReturnCode% NEQ 0 (if %z_ReturnCode% NEQ 4 (erase %z_file%.MLC | ||
|
@@ -69,7 +72,9 @@ exit /b %z_ReturnCode% | |
echo . | ||
echo the CBLCL.BAT procedure is intended to compile and link a single cobol program | ||
echo . | ||
set /P z_file=Hit Enter for more help or suppply name of cbl file to compile and link: | ||
:retry | ||
set z_file= | ||
set /P z_file=Hit Enter for more help or supply name of cbl file to compile and link: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cbl should be CBL. |
||
if /I %z_file%. NEQ . goto chkfile | ||
|
||
call %~dps0help %z_TraceMode% | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cbl should be CBL.