大鸟,飞起来 发表于 2005-12-10 02:18:37

网站内部培训内容2


<%
function calc(num1,num2)
num3=num1+num2
calc=num3
end function
'a=1
'b=2
'c=a+b
'response.Write(a&"+"&b&"="&c)
a=1
b=3
response.Write(a&"+")
response.Write(b&"=")
response.Write(calc(a,b))
%>

请将此程序改为计算器,必须使用function

大鸟,飞起来 发表于 2005-12-10 03:29:37


<script language="JavaScript" type="text/JavaScript">
<!--
function del()
{var bigbird = window.confirm("删除管理员之后不可恢复,确定删除请按“确认”键!");
   if ( false == bigbird )
    {      return false;
   }
}
-->
</script>


大鸟,飞起来 发表于 2005-12-19 00:59:35


<%
' ============================================
' 取实际字符长度
' ============================================
Function GetLen(str)
Dim l, t, c, i
l = Len(str)
t = l
For i = 1 To l
c = Asc(Mid(str, i, 1))
If c < 0 Then c = c + 65536
If c > 255 Then t = t + 1
Next
GetLen = t
End Function

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

<table border="1" cellspacing="0" cellpadding="0">
<tr>
    <td height="20">名</td>
    <td>内容</td>
    <td>len()</td>
    <td>lenB()</td>
    <td>GetLen()</td>
</tr>
<tr>
    <td width="31">t1</td>
    <td width="186">
<%
response.Write(t1)
%>
</td>
    <td width="105"><%=len(t1)%></td>
    <td width="105"><%=lenB(t1)%></td>
    <td width="105"><%=GetLen(t1)%></td>
</tr>
<tr>
    <td height="20">t2</td>
    <td>
<%
response.Write(t2)
%></td>
    <td><%=len(t2)%></td>
    <td><%=lenB(t2)%></td>
    <td><%=GetLen(t2)%></td>
</tr>
</table>

香耐儿 发表于 2009-4-10 09:31:59

非常好的好贴。。。

非常好的好贴。。。
页: [1]
查看完整版本: 网站内部培训内容2