Re: DO D1%I=1,10

From: Richard E Maine (nospam_at_see.signature)
Date: 01/13/05


Date: Thu, 13 Jan 2005 08:07:09 -0800

In article <1105630873.454085.95720@f14g2000cwb.googlegroups.com>,
 "Joost" <jv244@cam.ac.uk> wrote:

> is this standard f95 ?
 [code using d1%I as a DO variable elided]

No.

> D1%I seems a scalar integer variable,

True. But that's not all that the requirement for a DO variable says.
You left out the word "named". The DO variable is also required to be a
named variable. D1%I is not a named variable. Note that a name is a
specific syntactic construct... the one about consisting of letters,
digits, and underscores, with the first character being a letter. In
particular, names do not include % characters.

The most obvious solution is to use a separate variable for your DO
variable, copying it into the structure as needed, perhaps as the first
line of the DO loop (and maybe after the loop if you also need to catch
the ending value).

An alternative is to make the structure a target and then declare
an integer pointer, say, P and set

  P => D1%I

Then you have your named variable P. But that might be a bit of overkill
(and have performance implications).

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


Relevant Pages

  • Re: Creating many letters(mail merge) from a single template in C#
    ... I can use for loop, ... //Here fo 10 recipients generate 10 letters ... But this code does not produce 10 letters, ... This reply is posted in the Newsgroup; please post any follow question or reply ...
    (microsoft.public.office.developer.automation)
  • Re: [QUIZ] Word Loop (#149) [SOLUTION]
    ... letters = word.split ... puts "No loop" ... puts letters ... Support Ruby Quiz by submitting ideas as often as you can: ...
    (comp.lang.ruby)
  • Re: Is Need Help with "Scan" ?
    ... OK is making good progress learn APL but have question now on loop ... with desired letters and lengths... ...  "A" has the hits, say ther are 9000. ... So want to search through all the letters in B (the 16000 64 array) ...
    (comp.lang.apl)
  • Re: asm string parsing
    ... cmp ah, 'Z'-'A' ... jbe good_char ... loop scan_chars ... I've rearranged the test for letters to come first, ...
    (comp.lang.asm.x86)
  • Re: /bin/ed syntax
    ... It's more a case AFAIK that /bin/ed uses the first character after the ... for some dim dark historic reason (like loop counters are often ... Fortran reserved those letters for denoting ...
    (alt.os.linux)