# htp on-line reference : INC

## syntax

`<imageurl url="http://my.domain.org/" path="/var/www/my.domain/">
<imageurl url="other.domain.org/" path="/var/www/other.domain/">
For this line: <img src="logo.gif">
the local filename "logo.gif" will be used to determine image dimensions
(no URL replacement).
For this line: <img src="http://my.domain.org/logo.gif">
the local filename "/var/www/my.domain/logo.gif" will be used.
But for this line: <img src="http://other.domain.org/logo.gif">
the local file cannot be found (no prefix match), so the image dimensions
will not be added.
Order is important; last IMAGEURL tag takes precedence:
<imageurl url="/" path="/var/www/htdocs/">
<imageurl url="/test/" path="/var/www/test/">
<img src="/image.gif"> and <img src="/test/image.gif"> are mapped to
/var/www/htdocs/image.gif and /var/www/test/image.gif, resp.
If the order of the imageurl lines would be swapped, the second
image would be mapped to /var/www/htdocs/test/image.gif.
`

## 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:

`<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.

hosted by Sourceforge HTML coding

Copyright © 1995–96 Jim Nelson. Copyright © 2001–2014 Jochen Hoenicke. Permission to reproduce and distribute this hypertext document granted according to terms described in the License section. last updated Sat May 16, 2015