Re: Character assignment question in Function
- From: David Groff <david.groff@xxxxxxxx>
- Date: Mon, 13 Aug 2007 16:21:03 -0400
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.
- Follow-Ups:
- Re: Character assignment question in Function
- From: glen herrmannsfeldt
- Re: Character assignment question in Function
- References:
- Character assignment question in Function
- From: David Groff
- Re: Character assignment question in Function
- From: Richard Maine
- Character assignment question in Function
- Prev by Date: Re: Updated Compiler Comparisons
- Next by Date: Re: compiler independent random_seed() (newbie)
- Previous by thread: Re: Character assignment question in Function
- Next by thread: Re: Character assignment question in Function
- Index(es):
Relevant Pages
|