John,
I am not sure how to understand your lines
! ...
. To make clear what I meant in my sample with the lines
...
please look at file create_static_libraries.bat following:
@echo off
setlocal
set MYCCOPTS=/FIXED_FORMAT/SAVE
if '%1' == '' (
set UPPERBOUND=5
) else (
set UPPERBOUND=%1
)
echo C Program generated > test_generated.for
echo SUBROUTINE SR1 >> test_generated.for
echo *(KSTEU) >> test_generated.for
for /L %%J in (1,1,%UPPERBOUND%) do (
echo INTEGER*2 MYI2_%%J >> test_generated.for
)
for /L %%J in (1,1,%UPPERBOUND%) do (
echo MYI2_%%J=1_2 >> test_generated.for
)
echo KSTEU=%UPPERBOUND% >> test_generated.for
echo return >> test_generated.for
echo end >> test_generated.for
if exist test_generated.obj del test_generated.obj
if exist test_generated.sl64 del test_generated.sl64
echo ftn95 test_generated /64 %MYCCOPTS%
ftn95 test_generated /64 %MYCCOPTS% > test_generated.log 2>&1
echo lo test_generated.obj > test_gen.txt
echo file test_generated.sl64 >> test_gen.txt
echo slink64 @test_gen.txt
slink64 @test_gen.txt
if ERRORLEVEL 1 (
echo Could not create archive test_generated.sl64
exit /B 1
)
echo C use_lib.for to use library test_generated.sl64 > use_lib.for
echo C >> use_lib.for
echo C Program generated >> use_lib.for
echo integer ksteu >> use_lib.for
echo character*1 c1 >> use_lib.for
echo call SR1 (ksteu) >> use_lib.for
echo write (*,*) 'The number is :',ksteu >> use_lib.for
echo write(*,*) 'Enter any key to exit' >> use_lib.for
echo read(1,'(A1)') c1 >> use_lib.for
echo end >> use_lib.for
echo ftn95 use_lib /64 %MYCCOPTS%
ftn95 use_lib /64 %MYCCOPTS%
echo lo use_lib.obj > test_use.txt
echo lo test_generated.sl64 >> test_use.txt
echo file use.exe >> test_use.txt
if exist use.exe del use.exe
echo slink64 test_use.txt
slink64 @test_use.txt
echo .\use.exe
.\use.exe
endlocal
If you execute this batch file, then the following files are created:
test_generated.for
test_generated.obj
test_generated.log
test_gen.txt
test_generated.sl64
use_lib.for
use_lib.obj
test_use.txt
use.exe
and file use.exe is ececuted and lines
The number is : 5
Enter any key to exit
are displayed. In order to verify which SALFORD DLLs have been loaded you may want to make use of the resource manager. It turns out that Dlls clearwin64.dll and salflib64.dll of ftn95 version 8.30 have been loaded as expected. You may exit programme use.exe by typing any key followed by the ENTER key.
Now you may call create_static_libraries.bat with an integer paramater (>5) to increase the number declarations an assignments in file test_generated.for (genarated by the batch file). In my environment, call
create_static_libraries.bat 93
works ok and executable use.exe creates the line
The number is : 93
. However, calling
create_static_libraries.bat 94
does not work and does **not **create static library test_generated.sl64.