defenv and defbody Tag
Purpose: The defenv tag defines a method (format 1) or class (format 2) that can be called by an environment tag, i.e. an HTML/XML like element with a content and an end tag or an empty element tag. The defenv tag can contain any mixture of HTML and heitml Tags including the special defbody tag.
When a tag named TagName occurs within a page, the body of the defenv tag is called and executed. As soon as the defbody tag is reached, the content of the TagName tag is called. defbody can be called zero, one, or many times.
The content of the call has the same local variables as the procedure containing the environment call. Using the defbody Tag inside the source code of the environment calls the content. Therefore defbody can so be used several times at any place inside the defenv, also within a loop or within other environments.
Unless defautoclose is used, the actual call must have an end-tag (e.g. <br>..</br>) or must be an empty- element-tag.(e.g. <br/>).
If there are multiple definitions for the same TagName, the textually last definition is active.
Parameter passing and redefinitions work as described in Methods. Output parameters are copied to the caller, each time the content is called and when the environment finally returns.
See Also: For a description of the inherit tag, see the inherit tag.
For example, environments are useful for defining Web Page layouts, etc. that control the "look and feel" of an application or module. A sample environment definition is as follows:
Now that the environment has been defined, it can be called as follows:
When the environment is called as in the above example, it begins by issuing
calls to the
© 1996-2023 H.E.I. All Rights Reserved.