Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tricking Fortran

Status
Not open for further replies.

Dgrosser

Programmer
Sep 18, 2012
1
0
0
US
I'm a new programmer in fortran, and I was hoping to create a user input program, that would turn those inputs into a huge sequence. So it starts off asking the user for simple numbers:

Number? !<- just what the output code looks like. Just trying to make it simple
*User input*

then goes to several other numbers, which ends with a true/false statement. After which I wanted to assign these numbers to parameters for a fellows program. The variable portion of the code works well. However, variables can't be assigned to constant values, so it doesn't work afterwards. I thought I could make it work by creating the variables first and then making a new set a parameter equal to the variable, but that doesn't work. Is there anyway to 'trick' fortran to have a user input in a program's parameters?

Thanks
 
It sound like this: can you help me to assign value 2 to all constants 1 in my code?
PARAMETER statements define symbolic names of CONSTANTS.
Don't mix up PARAMETER defined names with routine parameters.
Better present your codes where you are trying "making a new set a parameter equal to the variable".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top