Re: Character assignment question in Function



Hi Richard,

You are right the email I sent did not provide enough data for anything
to be understood. For future issues I will be far more careful to provide enough data for the situation to be understood (also so that others can learn if applicable). The specific problem (which I did not describe in this email or at best poorly described)
has been resolved.

Thank You for your time.

Richard Maine wrote:
David Groff <david.groff@xxxxxxxx> wrote:

CHARACTER( * ), OPTIONAL, INTENT( IN ) :: filename

I believe the argument is being passed in succesfully(I can print the
argument inside the function), but I am unable to assign the argument to
a local CHARACTER variable in the function. Also "PRESENT(filename)" is
returning false within the function. I'm probably looking over something
very basic.

You need to show us far more of the code. This isn't enough data to
conclude anything useful. You say that you "believe the argument is
being passed succesfully.' Well, evidently that belief is wrong. It is
extremely odd that present should return false, while you are still able
to print the value. If present returns false, you shouldn't be able to
do much of anything at all with the variable - certainly not print it.

Rule number 1 of asking for debugging help: show us instead of telling
us. The only thing you showed us is the single declaration line (which
is good, but not enough). All the rest of the data is just you telling
us your interpretation of what is happening. When asking for debugging
help, you generally have misunderstood something, so your interpretation
is likely to be wrong. If is *VERY* common in such cases for the
misunderstanding to be related to something that you didn't think to
show at all, which makes it pretty impossible to debug. Please take the
"you" here as being abstract rather than personal. This is a very common
scenario here, not limitted to you personally.

This really needs a cut down runnable sample of code. I can't even tell
what you think is happening from the description, because the
description is too vague. You say that you are "unable to assign", which
isn't a very precise description. In what way are you unable? Does it
fail to compile such an assignment. (Doesn't sound like it from context,
but it does from that description.) The program crashes and you think it
is during the assignment? You print out the value of the assigned
variable and don't get the value you expect? Something else?

But I shouldn't even ask that question because that will probably prompt
you to try to answer it instead of showing the code, which is what is
really needed. I'm really just posing the question as an example of why
a description is inadequate. But it is only an example. If you answer
that question of what you mean by unable to assign", it still won't be
enough information without seeing the code.

.



Relevant Pages

  • Re: Character assignment question in Function
    ... us your interpretation of what is happening. ... help, you generally have misunderstood something, so your interpretation ... If is *VERY* common in such cases for the ... fail to compile such an assignment. ...
    (comp.lang.fortran)
  • Re: Newbie question about db normalization theory: redundant keys OK?
    ... Isn't that purely a question of what propositions we want to represent? ... interpretation, which the database was never designed to support. ... implement anything like a ROWVERSION in a true RDBMS. ... A problem arises with relational assignment - something that SQL doesn't ...
    (comp.databases.theory)
  • Re: Remebering the order of precedence
    ... ABOVE unary e.g. the very common *p++ ... assignment relative to the comparison and logical operators. ... hence 'below the bottom' of the operator precedence list. ...
    (comp.lang.c)
  • Re: Newbie question about db normalization theory: redundant keys OK?
    ... how you conclude that for FOL there MUST be separate interpretations just ... temporal database models and even logic programming that don't require ... an interpretation is an assignment. ...
    (comp.databases.theory)
  • Re: Is Assignment in a Conditional an Idiom?
    ... Goes to show you that ruby offers plenty of rope to hang yourself if you are ... It's not really a feature of Ruby, it is common in many languages and is ... For example, in C/C++, assignment is always true, so in cases when you ... intend to do comparison but miss the second equals sign, ...
    (comp.lang.ruby)