Paul
There seems to have been a misunderstanding on my side as to how '/VPARAM' is used. Unfortunately, things are getting even more confusing. Let me explain.
From the FTN95 documentation:
'[big]Salford Conditional compilation[/big]
FTN95 provides conditional compilation by means of the SPECIAL PARAMETER statement together with the /SPARAM and /VPARAM compile-time options and the CIF, CELSE and CENDIF statements.'
To me, 'compile-time option' could have meant either an option given to the compiler from the command line, that is a compiler switch. Or it could have meant a line of source code that is interpreted during compilation, before the actual source code.
Because of what was stated in the documentation (see below), I understood it to be the latter. From what you are saying it seems to be the former.
The documentation continues:
'The specification statement
SPECIAL PARAMETER <name>
defines <name> to be of type integer. <name> must not appear in a type statement and is local to the program unit in which the SPECIAL PARAMETER statement appears. The value represented by <name> is set by means of the /SPARAM or /VPARAM compile-time option as follows:
/SPARAM <integer>
where <integer> is the required value.'
It seemed to me that 'SPECIAL PARAMETER <name>' was meant to be a line of source code. This also corresponds to the reference to 'program unit', which I assumed to be either the source files in the project (f95, inc, ...), or more likely the logical components, i.e. main program and modules.
A compiler switch isn't local to any of these units. Hence, I assumed that the 'SPECIAL PARAMETER' line was meant to be in the source code.
I further assumed it to be the declaration of the parameter, so it seemed logical that the assignment of a value to that parameter would come after the declaration and therefore also inside the source code. As I understood it, '/VPARAM' and '/SPARAM' are used to assign values to such special parameters.
So, if '/VPARAM' is to be used as a compiler switch, what does 'SPECIAL PARAMETER' do and how is it used ?