HTP

htp on-line reference : INC

Table of Contents
  Introduction
  License
  Tutorial
  Usage
  HTP Tags
    ALTTEXT
    BLOCK
    BLOCKDEF
    DEF
    FILE
    IF
  > INC
    IMG
    IMAGEURL
    OPT
    OUTPUT
    QUOTE
    SET
    UNDEF
    UNSET
    USE, $
    WHILE
    <!---
  History
  Wish list
  Bugs

syntax

<[ref]INC macroname1="increment1" [macroname2="increment2" ... ] [GLOBAL]>

synopsis

The INC can be used for incrementing/decrementing a variable or for variable addition. The basic form is shown above.

The "increment" is anything that evaluates to a integer. It can be a literal string or a macro preceeded by the '$'-operator. The macroname must be the name of a defined macro that contains an integer. If the increment is ommitted it defaults to 1. The effect of this operation is that the macro is redefined to contain the sum of its previous value and its increment.

To increment or decrement a variable you can use this form:

    <[ref]INC i="1" j="-1">

Note that INC doesn't check if the strings really denote integers. It may give weired results when used on arbitrary strings. The integer values are limited to the range -2^31..2^31.

Note further that htp wasn't designed to do extensive calculations. The INC tag is useful in conjunction with WHILE to iterate over the defined blocks.

  page source
  htp project
  htp homepage
hosted by
SourceForge.net
HTML coding Powered by htp
htp on-line reference / http://htp.sourceforge.net/ref/
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2003 Jochen Hoenicke.
Permission to reproduce and distribute this hypertext document granted according to terms described in the License section.

last updated Tue Feb 22, 2011