It won't compile the FOO program.  Here are the error messages:

Compiling Unibasic: ../SERVICE/PGMS/TEST in mode 'p'.
main program: syntax error at or before
<line 4>   DELETE F,"KEY"
         ----------^
Expecting: =,:,+,-,*,/,[,<

main program: syntax error at or before
<line 6>   INFO = DELETE(INFO,1)
         --------------------^
Expecting: array,string,number,function,variable,OR,AND,!,>,>=,<,<=,=,<>,MATCH,C
AT,:,+,-

Warning: there are some statements after END near line 11
compilation failed


I've also gotten a user-written function to compile and run

001: FUNCTION TEMP(F1,F2,F3)
002: RETURN F1+F2+F3
003: END


0001: *-------------------------------------------------------------------
0002: DIM TEF(5)
0003: EQU TEF.PARTS    TO TEF(1)
0004: EQU TEF.TAX      TO TEF(2)
0005: EQU TEF.SHIPPING TO TEF(3)
0006: EQU TEF.SUB.TOT  TO TEMP(TEF.PARTS,TEF.TAX,TEF.SHIPPING)
0007: *
0008: DEFFUN TEMP(F1,F2,F3)
0009: *
0010: TEF.PARTS    = 100
0011: TEF.TAX      = 10
0012: TEF.SHIPPING = 20
0013: *
0014: PRINT TEF.SUB.TOT    ; * PRINT 130
0015: END


I even played around with the SADD function in an EQUATE.  Interesting.

Ed

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Tony Gravagno
Sent: Friday, April 06, 2007 4:56 PM
To: [email protected]
Subject: RE: [U2] [UD] Dynamic variable


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/

______________________________________________________________________
This e-mail has been scanned by MCI Managed Email Content Service, using 
Skeptic(tm) technology powered by MessageLabs. For more information on MCI's 
Managed Email Content Service, visit http://www.mci.com.
______________________________________________________________________

______________________________________________________________________
This e-mail has been scanned by MCI Managed Email Content Service, using 
Skeptic(tm) technology powered by MessageLabs. For more information on MCI's 
Managed Email  Content Service, visit http://www.mci.com.
______________________________________________________________________
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to