It would be nice to get support for variable number of arguments in STDCALL and C_EXTERNAL.
It could be defined with ..., something like:
C_EXTERNAL name 'alias' (INSTRING, ...)
I am currently prototyping a library for interfacing with COM (Component Object Model) directly from FTN95 and this functionality would be handy.
Currently I am forced to use something like, or is there a better way?:
integer :: pObject
integer :: argv(1)
character(20) :: fname
fname = 'test.txt'C
argv(1) = loc(fname)
call COMinit()
pObject = COMnew('Demo.Application')
call COMcall(pObject, 'Open', '%s', 1, argv)
call COMrelease(pObject)
call COMclose()
Basically, I am using a printf() style format string to define types of the variable number of arguments. Arguments are passed as a vector of pointers to parameters. I also pass the number of arguments for the function.
With support for variable number of arguments, I could get rid of argument vector and just pass the actual arguments for the function and let compiler worry about the rest.