Advertising banner:
 
 
 A155
 
81203_43854_21.png81203_43840_19.png

The following is an alphabetical listing of Internet Services script commands along with a brief description of their syntax and function. For an introduction to commands, see About Internet Services script library.



#config
This command is used to configure various aspects of the Internet Services script processing engine. There are 4 variants, each used to configure a different aspect of Internet Services Script's functionality.
Syntax
•       <!--#config timefmt="DateFormat"-->
        Used to configure the output of the Internet Services script dates, which do not support inline formatting options. Examples are the #flastmod command and some of Internet Services Script's global constants (for example, DATE_LOCAL, DATE_GMT).
81203_42521_14.png        Note
Dates retrieved using X-FC tags all support inline formatting so they remain unaffected by this configuration option. The formatting options available for the TimeFormat are the augmented C strftime formats defined for tag date formats (see X-FC-FIELD DATE tag for a list of possible options in the Internet Services X-FC tags document).
        The default date format is the Internet fixed width date format (without timezone): "%a, %d %b %Y %H:%M:%S" (for example: Mon, 01 Apr 2002 18:00:00).
•       <!--#config escapechars="CharList"-->
        Used to configure additional characters to be escaped by the Internet Services script '@escape()' function. The default set consists of quote ('), double-quote ("), carriage return (ASCII 13), line feed (ASCII 10), and backslash (\) (see the @escape function in Internet Services script functions).
•       <!--#config errmsg="New SSI error message"-->
        Used to set a user defined error message to be inserted into the rendered HTML stream when an Internet Services script error occurs.  
        New error messages must be <= 255 characters in length.
81203_42521_14.png        Note
The default error message is "<b>SSI Error</b>", but if you are using a lot of Javascript or other scripting language in your template or server parsed files, you could define a less HTML-centric error message, or perhaps just turn off error messages entirely in your production templates.
•       <!--#config sizefmt="Size Format"-->
        This command is used to control the output format of the #fsize command.  Currently, the only valid options are "bytes" and "scaled".
        "Bytes" outputs the current file's size in bytes.  "Scaled" selects an appropriate scaling factor (for example K, M, G, T etc...) for the output.  The default format is "Scaled".



#echo
This command is used to insert a variable value or the result of a mathematical computation into the rendering stream.
Syntax
•       <!--#echo var="VariableName"-->
        Inserts the value of VariableName into the rendering stream.  Unlike most variable references, you don't need the $ prefix here.
•       <!--#echo expr="Expression"-->
        Calculates the result of Expression and inserts it into the rendering stream.



#exec
Executes the specified CGI. See FirstClass Internet Services Administrator's Guide for information on GGIs.
Syntax
<!--#exec cgi="DiskPath"-->



#flastmod
Outputs the last modified date of a specified file.
Outputted format can be controlled by using <!--#config timefmt=""-->.
81203_42521_14.png        Note
This command should not be used to access the size of the current context object or sub-object it contains. The X-FC tags <X-FC-ITEM DATA[Size]> and <X-FC-LIST-ITEM COLUMN[Size]> are more efficient for this purpose
See X-FC-ITEM and X-FC-LIST-ITEM in Internet Services X-FC tags.
Syntax  
•       <!--#flastmod virtual="AbsolutePathName"-->
This syntax is used to output the last modified date of a file located using an absolute path (for example, one relative to the site root)
•       <!--#flastmod file="RelativePathName"-->
This syntax is used to output the last modified date of a file located using a relative path (for example, one relative to the current object)



#fsize
Outputs the size of a specified file.
The format of the output can be controlled by using the <!--#config sizefmt=""--> command.
81203_42521_14.png        Note
This command should not be used to access the size of the current context object or sub-object it contains. The X-FC tags <X-FC-ITEM DATA[Size]> and <X-FC-LIST-ITEM COLUMN[Size]> are more efficient for this purpose.
See X-FC-ITEM and X-FC-LIST-ITEM in Internet Services X-FC tags.
Syntax  
•       <!--#fsize virtual="AbsolutePathName"-->
        This syntax is used to output the size of a file located using an absolute path (for example, one relative to the site root)
•       <!--#fsize file="RelativePathName"-->
        This syntax is used to output the size of a file located using a relative path (for example, one relative to the current object)



#if
#else
#elif
#endif
Provides basic branching functionality for your templates and server-parsed files.
An Internet Services script 'if' block consists of the #if statement (with an expression), followed by zero or more #elif statements (each with an expression), followed by zero or one #else statement followed by the #endif statement.
Between any two consecutive stamens, you can have a data block of arbitrary complexity and length. Of the entire #if block, at most one of these data blocks is inserted into the rendering stream based on the conditions of the expressions. If the expression of the #if stamen evaluates to 'true', the block following it is the one inserted. Otherwise, Internet Services will consecutively check each #elif stamen expressions (if any), and if any of them are true, the next block will be inserted.
If none of the expressions are true, and there is an #else statement, the block inserted will be the one between the #else and the #endif. If none of the expressions are true and there is no #else command, nothing will be inserted.
For further details of what can be put in an expression and the rules Internet Services uses to determine the truth or fallacy of a given expression, see the section on Internet Services script expressions in Internet Services X-FC tags.
Syntax
<!--#if expr="Expression"-->
<data block>
(<!--#elif expr="Expression"-->
<data block>)*
[<!--#else-->
<data block>]
<!--#endif-->



#include
Inserts the contents of another file into the rendering stream.
Some common uses of this are to include a highly volatile collection of data placed in a separate file so it can be easily updated, or to include sections of "common" code used in several files or templates.
Most modern template sets use included files for toolbars, which are common between many templates. If the included file is server parsed, then it will inherit the context of the including file (for example, if you included a toolbar in a message template that toolbar will appear in the message context for the use of X-FC tags).
This means, if you use X-FC tags that extract data about the current object the object used for the data will be the including file not the included one. For example, if the document template included a file called "title.inc", and title.inc used the <X-FC-ITEM DATA[Name]> tag, then when the page was rendered, Internet Services would replace that tag with the name of the current document (for example, the template's scope), not the name of the include ("title.inc"). This allows template designers to use include files as a form of macro.
Syntax
<!--#include virtual="AbsolutePathName"-->
This syntax is used to insert a file located using an absolute path (for example, one relative to the site root).
<!--#include file="RelativePathName"-->
This syntax is used to insert a file located using a relative path (for example, one relative to the current object).



#printenv
Provided solely for compatibility with Apache's XSSI command set. This command has no function in Internet Services script.
Syntax
<!--#printenv -->



#rem
Inserts a comment in your templates and server-parsed files.
Comments are "compiled out" when this file is first loaded, and not sent to the browser. This allows you to insert comments of arbitrary length without incurring the performance penalty of sending them over the wire to the browser, allowing for templates that have much better internal documentation. Comments can be as long as desired, and can contain any sequence of characters except (obviously) "-->".
        Warning
Never end a file with an unclosed comment, as this can render the whole file inoperative.
Styling conventions for commented code
In FirstClass web templates, we use green for all comments (for example, Internet Services Script's <!--#rem-->, HTML's <!-- --> and JavaScript's // and /* */) to differentiate them from active code. As is the case with all our styling conventions, this is just for convenience as it greatly improves the readability of the templates. Although not necessary, we recommend you follow this convention, as it simplifies template debugging.
Syntax
<!--#rem remark  -->



#set
Creates a new Internet Services script variable and/or stores a value in this variable for later retrieval.
If the name you specify is for a variable already defined, the new value replaces the old one. The name of the variable cannot be the same as that of one of the pre-defined Internet Services global constants. The value stored can be either a static value or the result of a mathematical expression.
81203_42521_14.png        Note
Do not include the $ prefix for the variable name specified in the var argument. If you do, the command will not function correctly.
Syntax
•       <!--#set var="VariableName" value="StaticValue"-->
Use this syntax to set the variable to a static value.  Static values include constants (either numeric or string),  X-FC tags, the values of other Internet Services script variables and Internet Services script global constants.
•       <!--#set var="VariableName" expr="Expression"-->
Use this syntax to set the variable to the result of the mathematical expression in the expr arg.  
For information on what can be put in an expression and the rules Internet Services uses to determine the truth or fallacy of a given expression, see the section on Internet Services script expressions in Internet Services X-FC tags.



#while
#endwhile
Provides looping functionality for templates and server-parsed files.
During the rendering process, the block of data between the #while and #endwhile is executed an arbitrary number of times as long as the expression argument for the #while command evaluates to true.
For information on what can be put in an expression and the rules Internet Services uses to determine the truth or fallacy of a given expression, see the section on Internet Services script expressions in Internet Services X-FC tags.
Syntax
<!--#while expr="Expression"-->
<<data block>>
<!--#endwhile-->



hirosue Shino Web Site