Ed wrote:
> Just discovered something kinda cool that I want to share:
> 
> Here are a set of equates:
> 
> 004:    EQU TEF.TOTAL.VAL   TO SUM(TEF.VAL)
> 0009:     PRINT "TOTAL  = ":TEF.TOTAL.VAL"R#3"
> 0010:     PRINT "SUM    = ":SUM(TEF.VAL)"R#3"
> When you run this, the variable "TEF.TOTAL.VAL" always "knows" the
> sum of the values in TEF.VAL!! 

That's interesting because in other cases it could be a bug.  Ed, since you
initiated this, could you tell us what happens with the following?  I don't
have UD installed here at the moment:

  EQU DELETE TO 1
  OPEN "FOO" TO F ELSE STOP
  DELETE F,"KEY"
  INFO = "BLAH"
  INFO = DELETE(INFO,1)

Does it give you an error telling you the delete lines are invalid?  If so
it could be converting to this:
  1 F,"KEY"
  INFO = 1(INFO,1)

In other MV systems we do NOT want to do something like this because the
code is compiled into the object, not evaluated at runtime like the SUM() :
  EQU SCREEN.HDR TO @(-1):@(20,0):"Top of Page..."

I would be careful about taking advantage of tricks like this simply
because it's a crap shoot as to whether the code will be portable to
another MV release - and even an upgrade of the current environment could
break this if some developer decided it was a bug that needed to be fixed.

Thanks for the tip.
T
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to