<% 
' Copyright 2000 Phone.com, Inc.  All rights reserved.
'
'   Subject to the terms and conditions of the SDK License Agreement,
'   Phone.com, Inc. hereby grants you the right to use the UP.SDK
'   software and its related documentation.
'
'   The Phone.com name and logo and the family of terms carrying the "UP."
'   prefix are trademarks of Phone.com, Inc. All other brands and product
'   names may be trademarks of the respective companies with which they
'   are associated.
'
' addDeckToDigest.asp
'
'   A VBScript example which illustrates navigation among a pair 
'   of cards and decks within a digest.
'
'   The first deck uses a table to layout the cards; 
'   the second deck uses just '|' to separate them.
'
' Declarations 
' 
Dim myDigest, deck1, deck2, nl, digestString

' A newline (linefeed) is appended to each line of WML to
' aid legibility of source dumped to the Sim Info Window.
'
' Constants
' 
nl      = Chr(10)

' A first deck
'
deck1 =         "<wml>" & nl
deck1 = deck1 & "  <card id=""card1"">"  & nl
deck1 = deck1 & "    <p><do type=""accept"" label=""deck 2"">" & nl
deck1 = deck1 & "      <go href=""?deck2""/></do></p>" & nl
deck1 = deck1 & "    <p><do type=""options"" label=""card 2"">" & nl
deck1 = deck1 & "      <go href=""#card2""/></do><br/>" & nl
deck1 = deck1 & "      <table columns=""2""><tr>" & nl
deck1 = deck1 & "        <td>deck 1</td><td></td></tr>" & nl
deck1 = deck1 & "        <tr><td></td><td>card 1</td></tr>" & nl
deck1 = deck1 & "      </table>" & nl
deck1 = deck1 & "    </p>" & nl
deck1 = deck1 & "  </card>" & nl
deck1 = deck1 & "  <card id=""card2"">" & nl
deck1 = deck1 & "    <p><do type=""accept"" label=""deck 2"">" & nl
deck1 = deck1 & "      <go href=""?deck2""/></do></p>" & nl
deck1 = deck1 & "    <p><do type=""options"" label=""card 1"">" & nl
deck1 = deck1 & "      <go href=""#card1""/></do><br/>" & nl
deck1 = deck1 & "      <table columns=""2""><tr>" & nl
deck1 = deck1 & "        <td>deck 1</td><td></td></tr>" & nl
deck1 = deck1 & "        <tr><td></td><td>card 2</td></tr>" & nl
deck1 = deck1 & "      </table>" & nl
deck1 = deck1 & "    </p>" & nl
deck1 = deck1 & "  </card>" & nl
deck1 = deck1 & "</wml>" & nl

' A second deck
'
deck2 =         "<wml>" & nl
deck2 = deck2 & "  <card id=""card1"">"  & nl
deck2 = deck2 & "    <p><do type=""accept"" label=""deck 1"">" & nl
deck2 = deck2 & "      <go href=""?""/></do></p>" & nl
deck2 = deck2 & "    <p><do type=""options"" label=""card 2"">" & nl
deck2 = deck2 & "      <go href=""#card2""/></do>" & nl
deck2 = deck2 & "      <br/>deck 2 | card 1" & nl
deck2 = deck2 & "    </p>" & nl
deck2 = deck2 & "  </card>" & nl
deck2 = deck2 & "  <card id=""card2"">" & nl
deck2 = deck2 & "    <p><do type=""accept"" label=""deck 1"">" & nl
deck2 = deck2 & "      <go href=""?""/></do>" & nl
deck2 = deck2 & "    </p>" & nl
deck2 = deck2 & "    <p><do type=""options"" label=""card 1"">" & nl
deck2 = deck2 & "      <go href=""#card1""/></do>" & nl
deck2 = deck2 & "      <br/>deck 2 | card 2" & nl
deck2 = deck2 & "    </p>" & nl
deck2 = deck2 & "  </card>" & nl
deck2 = deck2 & "</wml>" & nl

' Create a new COM Digest object.
'
set myDigest            = Server.CreateObject("PDCDigestUtils.CPDCDigest")

' Add a first deck to the digest using an empty relative URL.
'
myDigest.DigestAddDeck  "", deck1

' Add a second deck using an URL relative to the first deck.
'
myDigest.DigestAddDeck  "?deck2", deck2

' Suppress content type output within the digest to prevent a 
' server from encapsulating WML content within a second boundary.
'
myDigest.DigestSuppressContentType 1

' Serialize the digest into a single output buffer, digestString.
'
digestString    = myDigest.DigestSerialize(0)

' Specify a deck of type WML to the digest object.
'
myDigest.DeckType         = 1

' Specify content type through the server response,
' rather than within the digest.
'
Response.ContentType    = myDigest.DigestGetContentType

' Write the response buffer to the client.
'
Response.BinaryWrite(digestString)
%>
