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

Discussion in 'C Programming' started by sara_patty, Nov 19, 2007.

  1. sara_patty

    sara_patty Guest

    fortran command for c command strcopy(infile, argv[1])
    sara_patty, Nov 19, 2007
    #1
    1. Advertising

  2. In article <>,
    sara_patty <> wrote:
    >fortran command for c command strcopy(infile, argv[1])


    That's going to depend on the fortran compiler, not upon C.
    comp.lang.fortran would be the appropriate newsgroup.

    [OT]

    See http://www.winteracter.com/f2kcli/
    --
    "I will speculate that [...] applications [...] could actually see a
    performance boost for most users by going dual-core [...] because it
    is running the adware and spyware that [...] are otherwise slowing
    down the single CPU that user has today" -- Herb Sutter
    Walter Roberson, Nov 19, 2007
    #2
    1. Advertising

  3. Re: Looking for Fortran command to get file names from arg listsin executable

    sara_patty wrote:
    > 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>
    Martin Ambuhl, Nov 19, 2007
    #3
  4. sara_patty

    Sjouke Burry Guest

    Re: Looking for Fortran command to get file names from arg listsin executable

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

    infile=argv(1)
    Sjouke Burry, Nov 20, 2007
    #4
  5. Re: Looking for Fortran command to get file names from arg lists in executable

    On Mon, 19 Nov 2007 16:14:19 -0500, Martin Ambuhl
    <> wrote:

    > sara_patty wrote:
    > > 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
    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).

    > </ot>

    - formerly david.thompson1 || achar(64) || worldnet.att.net
    David Thompson, Dec 3, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luna Moon
    Replies:
    9
    Views:
    599
    Guest
    Sep 4, 2007
  2. n00m
    Replies:
    5
    Views:
    384
  3. deadpickle
    Replies:
    1
    Views:
    946
    Jens Thoms Toerring
    Nov 7, 2010
  4. Replies:
    7
    Views:
    161
  5. Replies:
    21
    Views:
    267
    Barry Schwarz
    Mar 5, 2014
Loading...

Share This Page