Skip to main content

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:


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

    generated description: studiosavefirstcsp3 20101

  5. Click Build–>Compile to recompile FirstPage.CSP

  6. Click View–>Web Page to see the new page:

    generated description: viewfirstcsp4 20142


To learn more about CSP Expressions, read CSP: Elements in the CSP QuickStart Tutorial.

FeedbackOpens in a new tab