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 [email protected] | w www.firstmac.com.au ________________________________________ From: [email protected] [[email protected]] on behalf of Wjhonson [[email protected]] Sent: Thursday, 4 July 2013 7:31 AM To: [email protected]; [email protected] 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! _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users ------------------------------------------------------------------------------- Note: This email (inc all attachments) is for the use of the intended recipient(s) only. Privileged or confidential information may be contained in this communication. If you have received this email in error, please notify the sender immediately and then delete all copies of this message from your computer network. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email without the author's prior permission. If you are the intended recipient and you do not wish to receive similar electronic messages from us in future, then please respond to the sender to this effect. We have taken precautions to minimise the risk of transmitting software viruses, but advise you to carry out your own virus checks on this email and its attachments. We do not accept liability for any loss or damage caused by software viruses and do not represent that this transmission is free from viruses or other defects. Firstmac Limited (ABN 59 094 145 963) (AFSL 290600) ------------------------------------------------------------------------------- _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
