校园天空

标题: 网站内部培训内容2 [打印本页]

作者: 大鸟,飞起来    时间: 2005-12-10 02:18
标题: 网站内部培训内容2

  1. <%
  2. function calc(num1,num2)
  3. num3=num1+num2
  4. calc=num3
  5. end function
  6. 'a=1
  7. 'b=2
  8. 'c=a+b
  9. 'response.Write(a&"+"&b&"="&c)
  10. a=1
  11. b=3
  12. response.Write(a&"+")
  13. response.Write(b&"=")
  14. response.Write(calc(a,b))
  15. %>
复制代码

请将此程序改为计算器,必须使用function
作者: 大鸟,飞起来    时间: 2005-12-10 03:29

  1. <script language="JavaScript" type="text/JavaScript">
  2. <!--
  3. function del()
  4. {  var bigbird = window.confirm("删除管理员之后不可恢复,确定删除请按“确认”键!");
  5.    if ( false == bigbird )
  6.     {      return false;
  7.      }
  8. }
  9. -->
  10. </script>
复制代码



作者: 大鸟,飞起来    时间: 2005-12-19 00:59

  1. <%
  2. ' ============================================
  3. ' 取实际字符长度
  4. ' ============================================
  5. Function GetLen(str)
  6. Dim l, t, c, i
  7. l = Len(str)
  8. t = l
  9. For i = 1 To l
  10.   c = Asc(Mid(str, i, 1))
  11.   If c < 0 Then c = c + 65536
  12.   If c > 255 Then t = t + 1
  13. Next
  14. GetLen = t
  15. End Function

  16. t1="一二三四五六七八九十"
  17. t2="1234567890"<BR>%>

  18. <table border="1" cellspacing="0" cellpadding="0">
  19.   <tr>
  20.     <td height="20">名</td>
  21.     <td>内容</td>
  22.     <td>len()</td>
  23.     <td>lenB()</td>
  24.     <td>GetLen()</td>
  25.   </tr>
  26.   <tr>
  27.     <td width="31">t1</td>
  28.     <td width="186">
  29. <%
  30. response.Write(t1)
  31. %>
  32. </td>
  33.     <td width="105"><%=len(t1)%></td>
  34.     <td width="105"><%=lenB(t1)%></td>
  35.     <td width="105"><%=GetLen(t1)%></td>
  36.   </tr>
  37.   <tr>
  38.     <td height="20">t2</td>
  39.     <td>
  40. <%
  41. response.Write(t2)
  42. %></td>
  43.     <td><%=len(t2)%></td>
  44.     <td><%=lenB(t2)%></td>
  45.     <td><%=GetLen(t2)%></td>
  46.   </tr>
  47. </table>
复制代码

作者: 香耐儿    时间: 2009-4-10 09:31
标题: 非常好的好贴。。。
非常好的好贴。。。




欢迎光临 校园天空 (http://bbs.xytk.com/) Powered by Discuz! X3.5