> Does anyone know how I can get the sum of values from a structure?
>
> Example:
>
> <cfscript>
>
> myStruct = structnew();
> myStruct.val1 = "1";
> myStruct.val2 = "3";
> myStruct.val3 = "2";
>
> </cfscript>
>
> I want to quickly return the sum, 6, without having to loop
> over the keys and all that. Is it possible?

Nope, the Array functions like Sum and Sort only work on single
dimensional arrays with simple values in them, so you're going to have
to loop over them - there aren't any Struct functions similar

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133
F: +44 (0)20 8686 7911

An ISO9001 registered company.

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to