From: Andi Stephens on 19 Jan 2007 16:16 My program encodes several different methods for doing the same thing. I'd like to choose among them at runtime, and in some languages I'd set a pointer to the chosen function, and then reference the pointer for each function call. Is there a way to do this in Fortran? Thanks, --Andi
From: Beliavsky on 19 Jan 2007 16:27 Andi Stephens wrote: > My program encodes several different methods > for doing the same thing. > > I'd like to choose among them at runtime, and > in some languages I'd set a pointer to the > chosen function, and then reference the pointer > for each function call. > > Is there a way to do this in Fortran? Yes, using the "procedure pointer" of Fortran 2003. It has been implemented in g95, and you can search "procedure pointer" in the gg95 newsgroup http://groups.google.com/group/gg95 for an example of its use.
|
Pages: 1 Prev: What is run-time error F6501? Next: pointer association with empty targets |