<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br><BR>Ah, could do.<BR><br><BR>But this is getting uglier than I thought.<BR>I just wondered if there was any internal way to parameter sum().<BR>e.g. my_array.sum(0,3);<BR><br><BR>That kind of thing.<BR>Looks like no.<BR><br><BR>> Date: Tue, 26 Jul 2011 16:15:39 +0100<br>> From: patrick.lockley@googlemail.com<br>> To: xerte@lists.nottingham.ac.uk<br>> Subject: [Xerte] Re: sum part of array?<br>> <br>> i forgot to read that part of the requirements.....<br>> <br>> doesn't flash have a slice?<br>> <br>> http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary067.html<br>> <br>> On Tue, Jul 26, 2011 at 4:11 PM, Dave Burnett <d_b_burnett@hotmail.com> wrote:<br>> ><br>> ><br>> > Legpuller.<br>> ><br>> ><br>> > Besides using the evil eval, how does it limit the indexes it acts on?<br>> ><br>> ><br>> ><br>> ><br>> ><br>> ><br>> >> Date: Tue, 26 Jul 2011 15:29:49 +0100<br>> >> From: patrick.lockley@googlemail.com<br>> >> To: xerte@lists.nottingham.ac.uk<br>> >> Subject: [Xerte] Re: sum part of array?<br>> >><br>> >> eval(array.join("+")) ?<br>> >><br>> >> On Tue, Jul 26, 2011 at 2:50 PM, Dave Burnett <d_b_burnett@hotmail.com><br>> >> wrote:<br>> >> ><br>> >> ><br>> >> > Just out of curiosity, is there any way to sum part of an array?<br>> >> ><br>> >> ><br>> >> > [1,2,3,4,5]<br>> >> ><br>> >> ><br>> >> > Lets say I have an index variable and I always will want to sum from 0<br>> >> > to<br>> >> > that variable.<br>> >> ><br>> >> ><br>> >> > pseudo<br>> >> > my_array.sum(0,var);<br>> >> ><br>> >> ><br>> >> > Or am I forced to loop + add?<br>> >> ><br>> >> ><br>> >> > Or any elegant way to create a temp array of the target elements and sum<br>> >> > on<br>> >> > that instead?<br>> >> ><br>> >> ><br>> >> > Dave<br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> > This message and any attachment are intended solely for the addressee<br>> >> > and<br>> >> > may contain confidential information. If you have received this message<br>> >> > in<br>> >> > error, please send it back to me, and immediately delete it. Please do<br>> >> > not<br>> >> > use, copy or disclose the information contained in this message or in<br>> >> > any<br>> >> > attachment. Any views or opinions expressed by the author of this email<br>> >> > do<br>> >> > not necessarily reflect the views of the University of Nottingham.<br>> >> ><br>> >> > This message has been checked for viruses but the contents of an<br>> >> > attachment<br>> >> > may still contain software viruses which could damage your computer<br>> >> > system:<br>> >> > you are advised to perform your own checks. Email communications with<br>> >> > the<br>> >> > University of Nottingham may be monitored as permitted by UK<br>> >> > legislation.<br>> >> ><br>> >> > _______________________________________________<br>> >> > Xerte mailing list<br>> >> > Xerte@lists.nottingham.ac.uk<br>> >> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> >> ><br>> >> > This message and any attachment are intended solely for the addressee<br>> >> > and<br>> >> > may contain confidential information. If you have received this message<br>> >> > in<br>> >> > error, please send it back to me, and immediately delete it. Please do<br>> >> > not<br>> >> > use, copy or disclose the information contained in this message or in<br>> >> > any<br>> >> > attachment. Any views or opinions expressed by the author of this email<br>> >> > do<br>> >> > not necessarily reflect the views of the University of Nottingham.<br>> >> ><br>> >> > This message has been checked for viruses but the contents of an<br>> >> > attachment<br>> >> > may still contain software viruses which could damage your computer<br>> >> > system:<br>> >> > you are advised to perform your own checks. Email communications with<br>> >> > the<br>> >> > University of Nottingham may be monitored as permitted by UK<br>> >> > legislation.<br>> >> ><br>> >> ><br>> >> ><br>> >><br>> >> _______________________________________________<br>> >> Xerte mailing list<br>> >> Xerte@lists.nottingham.ac.uk<br>> >> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> ><br>> > This message and any attachment are intended solely for the addressee and<br>> > may contain confidential information. If you have received this message in<br>> > error, please send it back to me, and immediately delete it. Please do not<br>> > use, copy or disclose the information contained in this message or in any<br>> > attachment. Any views or opinions expressed by the author of this email do<br>> > not necessarily reflect the views of the University of Nottingham.<br>> ><br>> > This message has been checked for viruses but the contents of an attachment<br>> > may still contain software viruses which could damage your computer system:<br>> > you are advised to perform your own checks. Email communications with the<br>> > University of Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> > _______________________________________________<br>> > Xerte mailing list<br>> > Xerte@lists.nottingham.ac.uk<br>> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> ><br>> > This message and any attachment are intended solely for the addressee and<br>> > may contain confidential information. If you have received this message in<br>> > error, please send it back to me, and immediately delete it. Please do not<br>> > use, copy or disclose the information contained in this message or in any<br>> > attachment. Any views or opinions expressed by the author of this email do<br>> > not necessarily reflect the views of the University of Nottingham.<br>> ><br>> > This message has been checked for viruses but the contents of an attachment<br>> > may still contain software viruses which could damage your computer system:<br>> > you are advised to perform your own checks. Email communications with the<br>> > University of Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> ><br>> ><br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br> </div></body>
</html>