For Programmers: Free Programming Magazines  


Home > Archive > Fortran > July 2007 > Re: language rules question: using a (passed in) parameter to define









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: language rules question: using a (passed in) parameter to define
dpb

2007-07-25, 7:08 pm

BenR wrote:
> Hello,
> I am working on a program where we send a variable defined as a
> parameter as an argument to a subroutine. In the subroutine, when I
> try to define another parameter using the parameter that was passed
> in, I get the following error:
>
> Error: This symbol must be a defined parameter or an argument of an
> inquiry function that evaluates to a compile-time constant.
> This is Compaq Fortran.
>
> so here is the structure:
>
> subroutine sub(x) !x was a parameter in the calling function
> integer x,y
> parameter(y=x+5)
> ...
> end sub
>
> Anyone know why this is behaving like this?


Because a PARAMETER must be an initialization expression and a variable
that is changeable at run time doesn't qualify.

--
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com