Skip to main content

Using Object Data

Now, we can use properties of the Film object, such as Title, simply by placing them within #( ... )#.

<b>Today's Show Times for #(Film.Title)#</b>

Note that we do not have to worry about closing this Film object when we are done with it. Caché takes care of that automatically.

—ShowTimes.csp—
ShowTimes.csp
<html> <body>
<csp:class encoded=1>
<csp:query 
        name="Times" 
        classname="Cinema.Show" 
        queryname="ShowTimes"
        P1='#(%request.Data("FilmID",1))#'>

        <csp:object 
        name="Film" 
        classname="Cinema.Film" 
        objid='#(%request.Data("FilmID",1))#'>

<font color="#0000FF" size="+2">
    <b>Today's Show Times for #(Film.Title)#</b>
</font>
<table cellpadding=5>
    <tr>
        <td><b>Time</b></td>
        <td><b>Theater</b></td>
    </tr>
<csp:while condition="Times.Next()">
    <tr>
        <td>#(Times.Get("StartTime"))#</td>
        <td>#(Times.Get("TheaterName"))#</td>

    </tr>
</csp:while>
</table>
</body> </html>
Note:

To continue with the next part of this tutorial, click here.

FeedbackOpens in a new tab