Looking for Fortran command to get file names from arg lists inexecutable

M

Martin Ambuhl

sara_patty said:
fortran command for c command strcopy(infile, argv[1])

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.
<ot>
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.

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.
</ot>
 
D

David Thompson

sara_patty said:
fortran command for c command strcopy(infile, argv[1])

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.
<ot>
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.
<still ot>
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
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top