You can also see what the I-type does by 

DLIST yourfile yourdictitem

It's the equivalent of VLIST for I-Types...


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Peter Cheney
Sent: Thursday, 4 July 2013 9:48 AM
To: U2 Users List
Subject: Re: [U2] Running total

I believe the expression in the second example is referred to as a compound 
expression?

Can't put my finger on the exact documentation but I seem to recall that 
compound expressions are broken up into "parts" (for want of a better term) 
delimited by a ';' and each "part" can be referenced throughout the entire 
expression by an @ number e..g. @1 refers to the first part and the nth part is 
@n etc.

So for:
LIST VOC SIZE EVAL "SIZE + @2;@"

My take on how this works is the the first part of the expression (SIZE + @2) 
can be referenced later on as @1, The second part is referenced as @ (instead 
of @2) and I believe is used to refer to the result of the entire expression 
(sum of all the parts).

Can @ in this case also be referenced as @2? It probably could but would break 
the expression.

Therefore the reference to @2 is causing the expression to grab the entire 
result using contents of @ (via @2 thus keeping it separate to @) and add it to 
SIZE which then becomes the new result (@) of the expressions and the whole 
thing is repeated.

Does that sound about tight? Or have I got it way wrong?

Cheers
Peter




Peter Cheney

Universe Engineer

t 07 3017 8837 | f 07 3002 8400

e peter.che...@firstmac.com.au | w www.firstmac.com.au



________________________________________
From: u2-users-boun...@listserver.u2ug.org 
[u2-users-boun...@listserver.u2ug.org] on behalf of Wjhonson [wjhon...@aol.com]
Sent: Thursday, 4 July 2013 7:31 AM
To: u2-users@listserver.u2ug.org; donr_w...@yahoo.com
Subject: Re: [U2] Running total

Can anyone explain this situation better.  I've only ever used the @ to 
simplify a few I-descriptors.

I have a dict item SIZE that is just the LEN(@RECORD)

So in this thread we've seen two EVAL solutions to a running total

LIST VOC SIZE EVAL "@1+SIZE"
LIST VOC SIZE EVAL "SIZE + @2;@"

In the first example is the @1 just saving the "previous result of THIS eval ?"

And then in the second example does the fact that SIZE is first in the Eval, 
effectively *push* the accumulator into position two or something?  So that's 
why you need @2 ?

And then what would be the meaning of ";@" at the end of that?

Pretty confusing stuff!


************** IMPORTANT MESSAGE *****************************       
This e-mail message is intended only for the addressee(s) and contains 
information which may be
confidential. 
If you are not the intended recipient please advise the sender by return email, 
do not use or
disclose the contents, and delete the message and any attachments from your 
system. Unless
specifically indicated, this email does not constitute formal advice or 
commitment by the sender
or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its subsidiaries. 
We can be contacted through our web site: commbank.com.au. 
If you no longer wish to receive commercial electronic messages from us, please 
reply to this
e-mail by typing Unsubscribe in the subject line. 
**************************************************************



_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to