FirstSpirit can calculate

Peter_Jodeleit
Crownpeak employee
Crownpeak employee
1 3 1,326

Ok, perhaps nothing for every-day-templating...

The first 10 square numbers:
   $CMS_VALUE([1..10].map(x -> x*x))$
Even numbers between 1 and 100:
   $CMS_VALUE([1..100].filter(x -> x.even))$
   $CMS_VALUE([1..50].map(x -> x * 2))$
The count of numbers between 1 and 100:
   $CMS_VALUE([1..100].fold(start:0,  x -> start+1))$

The sum of numbers from1 and 100:
    $CMS_VALUE([1..100].fold(y:0, x -> x+y))$==$CMS_VALUE((100 * 101) /  2)$

The product of numbers from 1 to 100 (factorial):

    $CMS_VALUE([1..100].fold(y:1, x -> x*y))$

Try the last one in a calculator Smiley Wink

Tested with FS4.2R2

3 Comments
boesebeck
Crownpeak employee
Crownpeak employee

i add the tag knowledgebase, you can pretty combine this with Sort / Filter database records  afterwards  by a field in a foreign table

boesebeck
Crownpeak employee
Crownpeak employee

i moved this post to the developer blog

gorecki
I'm new here

This is very nice!

Version history
Last update:
‎06-30-2010 08:41 AM
Updated by: