Skip to main content
Previous section   Next section

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 )#
. Here is the format:

 #(Expression)#
Here are the steps for adding a CSP expression to FirstPage.CSP:
  1. Open FirstPage.CSP in Studio.
  2. 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"%>                                   
                     
  3. 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>         
                     
  4. FirstPage.CSP code looks like this
    images/tvqs_studiosavefirstcsp3_20101.png
  5. Click Build–>Compile to recompile FirstPage.CSP
  6. Click View–>Web Page to see the new page:
    images/tvqs_viewfirstcsp4_20142.png
Note:
To learn more about CSP Expressions, read CSP: Elements in the CSP QuickStart Tutorial.
Previous section   Next section