<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to write a code to get even numbers between 1 to 100?</title><link>https://community.appian.com/discussions/f/general/20939/how-to-write-a-code-to-get-even-numbers-between-1-to-100</link><description>How to write a code to get even numbers between 1 to 100?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to write a code to get even numbers between 1 to 100?</title><link>https://community.appian.com/thread/81576?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 12:55:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a96a23c7-57a4-493f-b7eb-77ebf45a9c56</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;yeah I do, for that&amp;nbsp;I wrote &amp;quot;personal&amp;quot;. ;)&lt;br /&gt;I like it regarding &amp;quot;readable code&amp;quot; for others.&amp;nbsp;&lt;br /&gt;It became a way more important parameter in my coding style as I dealt with different coding styles in&amp;nbsp; the same appian element and got in trouble to understand the different approaches/fixes of the same issue within a few code lines.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to write a code to get even numbers between 1 to 100?</title><link>https://community.appian.com/thread/81574?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 12:43:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3559b4e4-b028-4abc-96cc-47bd3df23406</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;As you know, using foreach to filter lists is not my prefered way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to write a code to get even numbers between 1 to 100?</title><link>https://community.appian.com/thread/81573?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 12:41:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76254ec2-0b84-4f98-87a5-5b3d30c51ff6</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Best way I have ever seen, stefan&lt;br /&gt;&lt;br /&gt;my personal method:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
    items: enumerate(100)+1,
    expression:{
        if(
         mod(fv!item,2),
         {},
         fv!item
        )
    }
)
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;requirements:&lt;br /&gt;if needed, check the mathematical meaning of modulus and how its working. &lt;br /&gt;the value 1 (as integer) -&amp;gt; can be interpreted as the boolean value &amp;quot;true&amp;quot; &lt;br /&gt;and the value 0 as false.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to write a code to get even numbers between 1 to 100?</title><link>https://community.appian.com/thread/81571?ContentTypeID=1</link><pubDate>Wed, 12 May 2021 11:25:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:810a7bf3-84c3-4e26-b47f-05a5cf58355e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;reject( /* Drops number where fn!mod returns 1 */
  fn!mod(_,2), /* Returns 0 for even numbers */
  1 + enumerate(100) /* Create list 1 ... 100 */
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>