<%@ Language=VBScript %> <% ' Check for a value passed on the address bar. if (Request.QueryString("i")) = "" then bFirst = true ' If we have a value for "i", we know that we can display the ' data in Excel. if (bFirst = false) then ' Buffer the content and send it to Excel. Response.Buffer = true Response.ContentType = "application/vnd.ms-excel" %> <% ' Build a multiplication table from 1,1 to i,j. for i = 1 to CInt(Request.QueryString("i")) Response.Write " " + vbCrLf for j = 1 to CInt(Request.QueryString("j")) if (j = 1) or (i = 1) then Response.Write " " + vbCrLf next Response.Write " " + vbCrLf next %> <% else ' The user hasn't loaded the page yet. Prompt them for ' values for the table. %> Please enter indices for the multiplication table:
i =
j =


<% end if %>
" else Response.Write " " end if Response.Write CStr(i*j) + "