Thursday, July 29, 2010

Reverse a string




<%
sometext = "Hello Everyone!"
response.write(strReverse(sometext))
%>





output>>>>
!enoyrevE olleH

Create an array




<%
Dim famname(5),i
famname(0) = "Jan Egil"
famname(1) = "Tove"
famname(2) = "Hege"
famname(3) = "Stale"
famname(4) = "Kai Jim"
famname(5) = "Borge"

For i = 0 to 5
      response.write(famname(i) & "
")
Next
%>




output>>>
Jan Egil
Tove
Hege
Stale
Kai Jim
Borge

Looping through HTML headers

html>


<%
dim i
for i=1 to 6
   response.write("Heading " & i & "")
next
%>




output is>>

Date and time

<%@ language="javascript" %>


<%
var d=new Date()
var h=d.getHours()

Response.Write("")
Response.Write(d)
Response.Write("
")
if (h<12)
   {
   Response.Write("Good Morning!")
   }
else
   {
   Response.Write("Good day!")
   }
%>



output is>>>>

Wed Jul 28 22:47:47 EDT 2010
Good day!