ComponentPro UltimateTemplateEngine

      Even

      Language Filter: AllSend comments on this topic to ComponentPro

      Even function checks to see whether a number is even or odd. It returns True if the variable is even, otherwise is False.

      Even(value)

      Parameter Type Description
      value object Value to check.

      The code below demonstrates how to use it:

      Template.tpl
      {%int a = 10/}
      
      $Even(a)$

      Output will be "True"

      using System;
      using System.Collections.Generic;
      using System.Text;
      using ComponentPro;
      
      namespace CSharp
      {
          public class Sample
          {
              [STAThread]
              static void Main()
              {
                  TemplateEngine dt = new TemplateEngine();
                  dt.LoadFromFile("Template.tpl");           
                  string output = dt.Run();
                  Console.WriteLine(output);
              }
          }
      }