Adding MVBasic Code — Expressions
CSP expressions provide another way to add MVBasic code to a page. Using a CSP expression you can include the value returned by a single MVBasic expression. The MVBasic expression must be surrounded by #( and
#(Expression)#
Here are the steps for adding a CSP expression to FirstPage.CSP:
-
Open FirstPage.CSP in Studio.
-
Verify that the following directive is at the very top of the file. The directive sets the default “page language” of the CSP page to MVBasic
<%@page language="mvbasic"%>
-
Replace any code or HTML currently between the <body></body> tags with the following:
<h2>Welcome to CSP!</h2> <p>The current date and time is #(TIMEDATE())#</p>
-
FirstPage.CSP code looks like this
-
Click Build–>Compile to recompile FirstPage.CSP
-
Click View–>Web Page to see the new page: