Re: Problem with my split routine I am not understanding



Donald Fredkin <drfredkin@xxxxxxxx> wrote:

The integer variables bpos, pos and idx are implicitly SAVED...

Let me add the "usual" correction here. (Perhaps if I correct people
often enough on it, eventually I'll stop needing to).

While the proposed solution of using executable statememts instead of
initialization is correct, this description of the problem is not.

The problem is not that the variables are saved. Indeed, in the
comparable situation in f77 (different initialization syntax needed, but
comparable meaning), the variables were not saved, but the same problem
could happen. In f77, the unsaved variables just became undefined, which
isn't what the OP wants either.

The problem is that, as *** described, the initialization happens only
once.

No, that is *NOT* the same thing. Saying that something is non-saved is
not the same thing as saying that it gets reinitialized.

It happens that as of f90, you can't declare something to be initialized
without also declaring it to be saved, which can cause some people to
blur thr distinction. But the two concepts are still distinct.

For the OP's purpose, it is irrelevant whether or not the variable is
saved. One doesn't even need to bring that matter up. What is important
is that the initialization is not redone.

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.


Quantcast