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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module to initialize user defined variables

Status
Not open for further replies.

hack11

Technical User
Dec 30, 2011
2
US
Is there a way to make variables declared in a module of user defined type 'read only' by programs that 'USE' the module? I can't use the 'PARAMETER' keyword because a user defined function is needed to initialize the values. Instead, the 'SAVE' keyword is used and a 'CONTAINED' subroutine is used to initialize the values.

I want to prevent programs from changing the values of the variables but don't know how.
 
Look at the keyword PROTECTED Fortran(2003 only)

François Jacq
 
Thanks for the tip. That would be perfect except a user defined function is needed to initialize the variable. I could perhaps include a copy of the user defined function within the module........
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top