home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 6 Unleashed…sional Reference Edition) / Visual_Basic_6_Unleashed_Professional_Reference_Edition_Sams_1999.iso / Source / CHAP07 / 309X01CD.TXT next >
Encoding:
Text File  |  1998-04-28  |  2.4 KB  |  84 lines

  1.  
  2. <HTML>
  3.  
  4. <HEAD>
  5.  
  6.   <TITLE>VBScript Sample</TITLE>
  7.  
  8.   <SCRIPT LANGUAGE="VBScript">
  9.   <!--
  10.     Sub RevealSolution()
  11.         Dim varSoltion, varLoopCtr
  12.         Dim varChar
  13.     varSolution = "Vjg ocp ycu vqq ujqtv vq tgcej vjg " _
  14.       & "dwvvqp hqt vjg hqwtvkgvj hnqqt -- dwv jg eqwnf tgcej vjg " _
  15.           & "dwvvqp hqt vjg vygpvkgvj hnqqt!"
  16.         lblAnswer.Caption = "" 
  17.         For varLoopCtr = 1 To Len(varSolution)
  18.            varChar = Mid(varSolution, varLoopCtr, 1)
  19.            If UCase(varChar) >= "A" And UCase(varChar) <= "Z" Then
  20.               varChar = Chr(Asc(varChar) - 2)
  21.            End If
  22.            lblAnswer.Caption = lblAnswer.Caption + varChar
  23.         Next 
  24.         lblAnswer.ForeColor = &H0
  25.     End Sub
  26.   -->
  27.   </SCRIPT>
  28.  
  29. </HEAD>
  30.  
  31. <BODY>
  32.  
  33. <FONT FACE="Arial" SIZE=4>
  34.  
  35. <TABLE BORDER="0">
  36.   <TR>
  37.     <TD VALIGN="Top" WIDTH="100">
  38.       <IMG SRC="QButton.gif" WIDTH=80 HEIGHT=100 BORDER=0
  39.         ALT="Question Mark">
  40.     </TD>
  41.     <TD>
  42.       <FONT SIZE=6><B><I>PUZZLE #1:</I></B></FONT>
  43.       <BR>
  44.       <B>A man lives on the top floor of a 40-story building.
  45.       Every day, he rides the elevator down to the first floor
  46.       and goes to work. However, when he comes home he takes the
  47.       elevator up to the 20th floor, then climbs the stairs the
  48.       rest of the way up to his home on the 40th floor. Why
  49.       does he do that? </B>
  50.       <BR><BR>
  51.       <FONT SIZE=2>
  52.         <B>Click on <FONT COLOR="#0000FF">Solution</FONT>
  53.         to reveal one possible answer.</B>
  54.       </FONT>
  55.     </TD>
  56.   </TR>
  57.   <TR>
  58.     <TD> </TD>
  59.     <TD>
  60.       <BR><BR>
  61.       <IMG ID="imgSolution" SRC="ABanner.gif" WIDTH=350 HEIGHT=40
  62.         ALT="Click here for solution" ONCLICK="RevealSolution">
  63.       <BR><BR>
  64.       <OBJECT ID="lblAnswer" WIDTH=467 HEIGHT=49
  65.          CLASSID="CLSID:978C9E23-D4B0-11CE-BF2D-00AA003F40D0">
  66.         <PARAM NAME="BackColor" VALUE="16777215">
  67.         <PARAM NAME="ForeColor" VALUE="16777215">
  68.         <PARAM NAME="VariousPropertyBits" VALUE="8388627">
  69.         <PARAM NAME="Caption" VALUE=""> 
  70.         <PARAM NAME="Size" VALUE="12347;1291">
  71.         <PARAM NAME="FontName" VALUE="Arial">
  72.         <PARAM NAME="FontEffects" VALUE="1073741825">
  73.         <PARAM NAME="FontHeight" VALUE="240">
  74.         <PARAM NAME="FontCharSet" VALUE="0">
  75.         <PARAM NAME="FontPitchAndFamily" VALUE="2">
  76.         <PARAM NAME="FontWeight" VALUE="700">
  77.       </OBJECT>
  78.     </TD>
  79.   </TR>
  80. </TABLE>
  81.  
  82. </BODY>
  83. </HTML>
  84.