This legacy functions to show the name of EXE file and the number of arguments when you call some xxx.exe program from the command prompt
C:> xxx.exe a b c
where a b c are parameters (total 3 here for example) from the times of FTN77 definitely has some very old devilry inside or i misuse something. It in some cases works and in another crashes the code. For example this first demo works ok showing the name of EXE file and that there are 3 arguments. But if i place declarations inside the module or call these functions from the subroutine it crashes. Compile ftn95 xxx.f95 /link /debug /64
CHARACTER*128 ProgEXEname, CMPROGNM@
integer*2 n_argComm_line, cmnargs@
ProgEXEname = CMPROGNM@()
n_argComm_line = cmnargs@()
print*, n_argComm_line, ' ', ProgEXEname
pause
end
module mo
use clrwin
CHARACTER*128 ProgEXEname, CMPROGNM@
integer*2 n_argComm_line, cmnargs@
end module
program aaa
use mo
ProgEXEname = CMPROGNM@()
n_argComm_line = cmnargs@()
print*, n_argComm_line, ' ', ProgEXEname
pause
end
