A scriptlet contains REXX code, which is copied without modification in the translated page. A scriptlet may be included in a REXXTAGS page, or returned as part of a tag result.
Included scriptlets are copied to the translated file, which may be eventually cached, and executed at request time. Returned scriptlets are interpreted when the tag results are evaluated.
REXXTAGS allows different syntactical notations for scriptlets.
Syntax 1 (included scriptlets only):
<?rexx rexx code fragment ?>
Syntax 2 (included scriptlets only):
<script type="rexx"> rexx code fragment </script>
Syntax 3 (included scriptlets only):
<script language="rexx"> rexx code fragment </script>
Syntax 4 (included and returned scriptlets):
<% rexx code fragment %>
Syntax 1, 2 and 3 are inherited from Mod_Rexx standard RSPCOMP Rexx Server Pages compiler, are retained for compatibility, and may only be used in included scriptlets. Syntax 4 is special to REXXTAGS, and may be used in included or returned scriptlets. In all cases, delimiters must appear on a line by themselves.
<% Do i = 1 To 10 %> This line will appear 10 times<br /> <% End %>
produces the following output:This line will appear 10 times
Here's a similar example which makes use of expressions:
<% Do i = 1 To 10 %> The square of <%=i%> is <%=i*i%><br /> <% End %>
Which prints:The square of 1 is 1
Last update: 05/06/03 at 14:11