Hi Dave,
In general, access to an element of a dimensioned array is fast so the
frequent references to PARM(12) should not be a problem.
On the other hand, even with the benefits of field level hints, repeated
references to the same field/value may be improved by extracting the data
into a temporary variable.
Incidentally, and at the risk of starting a new war on style, this is a
great example of why developers should use equate tokens with meaningful
names rather than numbers for field references. As someone who has never
seen this code before, I haven't got a clue what it does. Using names
hopefully makes the code readable, it makes it easy to find all references
to a particular item without having to dismiss all the other references to
the same field in a different file, and it reduces errors from typos. Ignore
me if you like. It's just a personal hate!!
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200
CM=MONTH+LY.CNT
FOR M=1 TO 12
IF PARMS(12)<101,CM>#'' OR PARMS(12)<133,CM>#'' OR
PARMS(12)<134,CM>#'' THEN
CUM(M)=PARMS(12)<101,CM>+PARMS(12)<133,CM>+PARMS(12)<134,CM>
END
IF PARMS(7)<100,CM>#'' OR PARMS(7)<101,CM>#'' OR
PARMS(7)<102,CM>#'' THEN
IF PARMS(7)<100,CM>#'' THEN CUMO(M)=CUMO(M)+PARMS(7)<100,CM>
ELSE
CUMO(M)=CUMO(M)+PARMS(12)<101,CM>
END
IF PARMS(7)<101,CM>#'' THEN CUMO(M)=CUMO(M)+PARMS(7)<101,CM>
ELSE
CUMO(M)=CUMO(M)+PARMS(12)<133,CM>
END
IF PARMS(7)<102,CM>#'' THEN CUMO(M)=CUMO(M)+PARMS(7)<102,CM>
ELSE
CUMO(M)=CUMO(M)+PARMS(12)<134,CM>
END
END
CM=CM-1; IF CM=0 THEN CM=24
NEXT M
RETURN
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users