[Xerte] Re: sum part of array?

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Jul 26 16:26:07 BST 2011


You want an engine method, or those additional parameters adding to sum()? Easy to do...

From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 26 July 2011 16:25
To: Xerte list
Subject: [Xerte] Re: sum part of array?



Ah, could do.


But this is getting uglier than I thought.
I just wondered if there was any internal way to parameter sum().
e.g. my_array.sum(0,3);


That kind of thing.
Looks like no.


> Date: Tue, 26 Jul 2011 16:15:39 +0100
> From: patrick.lockley at googlemail.com
> To: xerte at lists.nottingham.ac.uk
> Subject: [Xerte] Re: sum part of array?
>
> i forgot to read that part of the requirements.....
>
> doesn't flash have a slice?
>
> http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary067.html
>
> On Tue, Jul 26, 2011 at 4:11 PM, Dave Burnett <d_b_burnett at hotmail.com> wrote:
> >
> >
> > Legpuller.
> >
> >
> > Besides using the evil eval, how does it limit the indexes it acts on?
> >
> >
> >
> >
> >
> >
> >> Date: Tue, 26 Jul 2011 15:29:49 +0100
> >> From: patrick.lockley at googlemail.com
> >> To: xerte at lists.nottingham.ac.uk
> >> Subject: [Xerte] Re: sum part of array?
> >>
> >> eval(array.join("+")) ?
> >>
> >> On Tue, Jul 26, 2011 at 2:50 PM, Dave Burnett <d_b_burnett at hotmail.com>
> >> wrote:
> >> >
> >> >
> >> > Just out of curiosity, is there any way to sum part of an array?
> >> >
> >> >
> >> > [1,2,3,4,5]
> >> >
> >> >
> >> > Lets say I have an index variable and I always will want to sum from 0
> >> > to
> >> > that variable.
> >> >
> >> >
> >> > pseudo
> >> > my_array.sum(0,var);
> >> >
> >> >
> >> > Or am I forced to loop + add?
> >> >
> >> >
> >> > Or any elegant way to create a temp array of the target elements and sum
> >> > on
> >> > that instead?
> >> >
> >> >
> >> > Dave
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > This message and any attachment are intended solely for the addressee
> >> > and
> >> > may contain confidential information. If you have received this message
> >> > in
> >> > error, please send it back to me, and immediately delete it. Please do
> >> > not
> >> > use, copy or disclose the information contained in this message or in
> >> > any
> >> > attachment. Any views or opinions expressed by the author of this email
> >> > do
> >> > not necessarily reflect the views of the University of Nottingham.
> >> >
> >> > This message has been checked for viruses but the contents of an
> >> > attachment
> >> > may still contain software viruses which could damage your computer
> >> > system:
> >> > you are advised to perform your own checks. Email communications with
> >> > the
> >> > University of Nottingham may be monitored as permitted by UK
> >> > legislation.
> >> >
> >> > _______________________________________________
> >> > Xerte mailing list
> >> > Xerte at lists.nottingham.ac.uk
> >> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte
> >> >
> >> > This message and any attachment are intended solely for the addressee
> >> > and
> >> > may contain confidential information. If you have received this message
> >> > in
> >> > error, please send it back to me, and immediately delete it.   Please do
> >> > not
> >> > use, copy or disclose the information contained in this message or in
> >> > any
> >> > attachment.  Any views or opinions expressed by the author of this email
> >> > do
> >> > not necessarily reflect the views of the University of Nottingham.
> >> >
> >> > This message has been checked for viruses but the contents of an
> >> > attachment
> >> > may still contain software viruses which could damage your computer
> >> > system:
> >> > you are advised to perform your own checks. Email communications with
> >> > the
> >> > University of Nottingham may be monitored as permitted by UK
> >> > legislation.
> >> >
> >> >
> >> >
> >>
> >> _______________________________________________
> >> Xerte mailing list
> >> Xerte at lists.nottingham.ac.uk
> >> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
> >
> > This message and any attachment are intended solely for the addressee and
> > may contain confidential information. If you have received this message in
> > error, please send it back to me, and immediately delete it. Please do not
> > use, copy or disclose the information contained in this message or in any
> > attachment. Any views or opinions expressed by the author of this email do
> > not necessarily reflect the views of the University of Nottingham.
> >
> > This message has been checked for viruses but the contents of an attachment
> > may still contain software viruses which could damage your computer system:
> > you are advised to perform your own checks. Email communications with the
> > University of Nottingham may be monitored as permitted by UK legislation.
> >
> > _______________________________________________
> > Xerte mailing list
> > Xerte at lists.nottingham.ac.uk
> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte
> >
> > This message and any attachment are intended solely for the addressee and
> > may contain confidential information. If you have received this message in
> > error, please send it back to me, and immediately delete it.   Please do not
> > use, copy or disclose the information contained in this message or in any
> > attachment.  Any views or opinions expressed by the author of this email do
> > not necessarily reflect the views of the University of Nottingham.
> >
> > This message has been checked for viruses but the contents of an attachment
> > may still contain software viruses which could damage your computer system:
> > you are advised to perform your own checks. Email communications with the
> > University of Nottingham may be monitored as permitted by UK legislation.
> >
> >
> >
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20110726/1f4bc356/attachment.html>


More information about the Xerte mailing list