Chapter 2 Getting Started with PowerDynamo


Creating a script

In this tutorial you create an HTML template that includes a script. Scripts provide programmatic control over the content of the HTML page. For example, they can be used to respond to forms filled out and submitted from a Web client.

Steps To add a script to your Web site:

  1. From Sybase Central, connect to the PowerDynamo sample site.

  2. In the left pane, click the Site folder. You may have to expand the Web site container to do this.

  3. In the right pane, double-click Add Script.

  4. Enter a name for the script, for example, Test . Do not include any spaces. Click Next.

  5. Enter a description; for example, "A test script".

    Click Finish. A script icon named test.ssc is added to the right pane of Sybase Central.

  6. Double-click test.ssc to edit the script. The Sybase Central editor displays an empty script template:

    <!--SCRIPT test.ssc
    /* A test script*/

    -->


  7. Add lines to the script, so it reads as follows:

    <!--SCRIPT test.ssc
    /* A test script*/
    document.Write ( "<HTML><BODY>" ) ;
    document.Write ( "<H1>A first heading</H1>") ;
    document.Write ( "</BODY></HTML>" ) ;
    -->


    These instructions write text into the document produced by the script.

    For information about the Dynamo script language, see "The DynaScript Language" in PowerDynamo Reference.

  8. Click the database icon to save the script.


Steps To view the script output:

  1. From Sybase Central, right-click on test.ssc.

  2. Select Execute from the pop-up menu. The output displays in the Sybase Central syntax-highlighting editor.


 


Copyright © 1999 Sybase, Inc. All rights reserved.