Caché Web Applications Tutorial
Retrieving a TicketItem
[Home] [Back] [Next]
InterSystems: The power behind what matters   

Now, we can retrieve each TicketItem object, using the GetAt method. Once we have an object, we display the start time, film title, and theater name.

Notice that we use the ObjectScript function $ZTIME, abbreviated by $ZT, to format the start time for display. For more on $ZTIME and other ObjectScript functions read the $ZTIME entry in the Caché ObjectScript Reference.
<html> <head></head>
<csp:class super="%CSP.Page,Cinema.Utils">
<csp:if condition='$D(%session.Data("Order"))'>
    <img src="YourTicketOrder.gif"><br>
    <script language="cache" runat="server">
        // Open Order object for display
        Set ord = ##class(Cinema.TicketOrder).%OpenId(%session.Data("Order"))
    <csp:loop counter="num" from=1 to=#( ord.Items.Count() )#>
        <script language="cache" runat="server">
            Set itm = ord.Items.GetAt(num)
        For the #($ZT(itm.Show.StartTime,4))#
        showing of #(itm.Show.Film.Title)#
        at #(itm.Show.Theater.TheaterName)#
</body> </html>

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA