for and forsep Tag

Format: <for Expression=Expression Expression Expression> heitml <forsep> heitml </for>

Purpose: The for tag is used to program a loop.

First, the assignment expression is evaluated. In general, the assignment expression initializes the loop variable. The second expression is evaluated before each loop iteration and must result in a Boolean expression. While the second expression evaluates to true, the actions defined in the body of the loop are executed. After each loop iteration, the third expression is evaluated. In general, the third expression increments or decrements the loop variable.

An optional forsep section can be specified which is executed between two loop iterations. In contrast to the third expression of the for tag which is evaluated after each loop iteration, the forsep section is not executed after the last loop iteration.

An alternative to the for loop is the while loop. To loop over all fields of an object or all characters of a string, use the forin loop.

Example:

input:resulting output:
<for i=0 i&le;10 i=i+1;
  ? i*2;
  forsep>,<
/for>
0,2,4,6,8,10,12,14,16,18,20

Note: The for Tag is Case Sensitive, which means that heitml will not recognize it if you use capital letters (e.g. <FOR Expression>).

This page was dynamically generated by the web application development tool RADpage of H.E.I.
© 1996-2017 H.E.I. All Rights Reserved.



Homepage
Intro/Features
Component Guide
Programming
  Language Guide
  Language Ref.
    General Design
    Lexical Structure
    Expressions
    Objects
    Methods
    Classes
    heitml Tags
      ? Tag
      assign Tag
      break Tag
      callenv Tag
      dbdatabase Tag
      dbquery Tag
      dbupdate Tag
      def Tag
      defautoclose Tag
      defbody Tag
      defclass Tag
      defcontpara Tag
      defenv Tag
      defhtml Tag
      definpara Tag
      defpara Tag
      defremovecdata Tag
      deftranspara Tag
      defwysiwyg Tag
      for Tag
      forin Tag
      forsep Tag
      if Tag
      elsif Tag
      else Tag
      include Tag
      includeonce Tag
      inherit Tag
      let Tag
      mail Tag
      return Tag
      shell Tag
      while Tag
      writefile Tag
      \ Tag
    heitml Functions
    Advanced Functions
    Database Access
    Global Variables
    Form Fields
    Server Variables
    Sessions
    heitml Syntax
  Component Ref.
  Class Library
  User Components
  Tryout Form
  Tutorial
  New Features
  heitml 1
User Guide
FAQ
Mailinglist
Discussion Group
Services
Pricing/Register
Download
Frame
 
Contact
 
 
 
Search: