On Mon, 19 Nov 2007 16:14:19 -0500, Martin Ambuhl
> sara_patty wrote:
> > fortran command for c command strcopy(infile, argv)
> Obviously it is better to ask Fortran questions in a Fortran newsgroup.
> People when posting in comp.lang.c should not be expected to have
> answers which are as reliable about Fortran as those in a Fortran newsgroup.
> Fortran does not standardly include the ability to inspect the command
> line. However, many implementations provide non-standard functions with
> names like GETARG, GET_COMMAND, GET_COMMAND_ARGUMENT, and
> COMMAND_ARGUMENT_COUNT. Check your implementation for details.
As of 'F03' (actually adopted in 2004), it does. (Many probably most
implementations also still provide their former extensions.)
This is frequently discussed on comp.lang.fortran, which indeed is the
better place for Fortran questions. And FORTRAN ones. (And the
difference between those! <G>) And I see that the OP has indeed posted
there and received good answers.
> For handling objects of type CHAR(*), check your Fortran text for the
> standard functions. You might want to look up "array assignment" in the
> index; '=' may be all you need.
No but yes. Fortran character string types -- CHARACTER(len) and in
limited cases CHARACTER(*) -- are not actually the same type as array
of character, as they are in C (and Pascal and Ada), though they are
represented that way internally. But intrinsic (builtin) assignment
(=) applies both to strings and most arrays including of characters.
Also note Fortran (builtin, un-F03-allocable) strings are fixed-length
blank-padded, not variable null-terminated as in C. Thus a number of
operations and idioms are different -- not necessarily better or
worse, just different -- and there's a (more serious) headache when
interfacing between the two languages (or others with similar issues).
- formerly david.thompson1 || achar(64) || worldnet.att.net