Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!sdd.hp.com!hplabs!hpfcso!acmeyer From: acmeyer@hpfcso.HP.COM (Alan C. Meyer) Newsgroups: comp.lang.fortran Subject: Re: Keyword and optional argments (was Fortran vs C) Message-ID: <9080009@hpfcso.HP.COM> Date: 1 Dec 90 17:32:01 GMT References: Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 31 >I 100% agree. And I note that this is incorporated in Fortran 90 >modules, one of my favorite Fortran 90 features. To elaborate a little (and be a little picky?), keyword arguments can be used in F90 for any procedure which has an "explicit interface". In F90, this means any intrinsic procedure, module procedure, or internal procedure can always be invoked with keyword arguments. In addition, it also includes any external procedure for which an interface block is accessible. So, to build on the given example, an external procedure "read_the_file" could also be called with keyword args like so - subroutine get_ready ... interface subroutine read_the_file(file,format,some_other_argument,into) use precision character, intent(in) :: file*(*) character, intent(in), optional :: format*(*) integer, intent(in), optional :: some_other_argument real(r_kind), intent(out) :: into end subroutine read_the_file end interface ... call read_the_file(into=some_array, file='...') Alan Meyer Colorado Language Lab Hewlett-Packard Brought to you by Super Global Mega Corp .com