|
|
||||
![]() | ||||
Because DI commands are contained within HTML comments, typing-in a large number of them can be not only time-consuming, but it can also decrease the reability of the HTML source code. For this reason, it is possible to place more than one command within the same HTML comment.
To end one command and start the next, insert a semi-colon (;)
and then simply type the next command without <!--. in front
of it. Note that the semi-colon is very important. Unlike other computer
languages, the DI will give lots of unusual errors and results if you accidentally
leave one out. Also, don't forget to end the comment with -->
after the last command.
Here are two versions of the same script. The first uses the long way of doing things:
<!--.cgivars--> <!--.ifdef myname--> <!--.echo "Your name is $myname"--> <!--.else--> <!--.echo "You didn't tell me your name"--> <!--.endif-->
and now the shorter method, using continuation:
<!--.cgivars; ifdef myname; echo "Your name is $myname"; else; echo "You didn't tell me your name"; endif-->
Note that this entire thing could have been put on one line, but it's far more readable with each command on its own line.
Home | Directories | Web Email | Calendar | Campus Map | Search | Help
About the College |
Admission |
Academics |
Student Life |
Athletics Copyright © 2001 Mount Holyoke College. This page created by the OIS Operations Group and maintained by Webmaster. Last modified on November 2, 2001. |