为什么只显示body里的内容 而reverse()函数没执行?<HTML>
<HEAD><TITLE>函数使用举例 反转字符串</TITLE>
<SCRIPT LANGUAGE="VBScript">Fuction reverse(oldstr)
Dim l,rever
l=Len(oldstr)
rever=""
For i=1 to l
ch=Mid(oldstr,l-i+1,l)
rever=rever&ch
Next
reverse=rever
End FunctionSub ShowReverse
Dim oldstr,newstr
oldstr=InputBox("请输入一个字符串:","字符串翻转")
newstr=reverse(oldstr)
MsgBox "输入的字符串为:" &oldstr&char(13)&chr(10)_
&"转换后的字符串为:"&newstr
End Sub
call ShowReverse() '调用ShowReverse过程
</SCRIPT>
</HEAD>
<BODY>……
</BODY>
</HTML>
<HEAD><TITLE>函数使用举例 反转字符串</TITLE>
<SCRIPT LANGUAGE="VBScript">Fuction reverse(oldstr)
Dim l,rever
l=Len(oldstr)
rever=""
For i=1 to l
ch=Mid(oldstr,l-i+1,l)
rever=rever&ch
Next
reverse=rever
End FunctionSub ShowReverse
Dim oldstr,newstr
oldstr=InputBox("请输入一个字符串:","字符串翻转")
newstr=reverse(oldstr)
MsgBox "输入的字符串为:" &oldstr&char(13)&chr(10)_
&"转换后的字符串为:"&newstr
End Sub
call ShowReverse() '调用ShowReverse过程
</SCRIPT>
</HEAD>
<BODY>……
</BODY>
</HTML>
<SCRIPT LANGUAGE="VBScript"> Fuction reverse(oldstr) <----------低级错误 Function 少了个n
Dim l,rever
l=Len(oldstr)
rever=""
For i=1 to l
ch=Mid(oldstr,l-i+1,l)
rever=rever&ch
Next
reverse=rever
End Function Sub ShowReverse
Dim oldstr,newstr
oldstr=InputBox("请输入一个字符串:","字符串翻转")
newstr=reverse(oldstr)
MsgBox "输入的字符串为:" &oldstr&char(13)&chr(10)_
&"转换后的字符串为:"&newstr
End Sub
call ShowReverse() '调用ShowReverse过程
</SCRIPT>
Sub ShowReverse
Dim oldstr,newstr
oldstr=InputBox("请输入一个字符串:","字符串翻转")
MsgBox 没执行?
<HEAD> <TITLE>函数使用举例 反转字符串 </TITLE>
<SCRIPT type="text/vbscript">Function reverse(oldstr)
Dim m, rever, ch
m = Len(oldstr)
rever = ""
For i = m to 1
ch = Mid(oldstr, i , 1)
rever = rever & ch
Next
reverse = rever
End FunctionSub ShowReverse()
Dim oldstr, newstr
oldstr = InputBox("请输入一个字符串:","字符串翻转")
newstr = reverse(oldstr)
MsgBox "输入的字符串为:" & oldstr & Chr(13) & Chr(10) & "转换后的字符串为:" & newstr
End Sub</SCRIPT>
</HEAD>
<BODY>
<script type="text/vbscript">
call ShowReverse
</script>
……
</BODY>
</HTML>
是不是我 iis 配置的问题啊
我是初学者哈 ,大家不要介意哈!
<HEAD> <TITLE>函数使用举例 反转字符串 </TITLE>
<SCRIPT type="text/vbscript">Function reverse(oldstr)
Dim m, rever, ch m = Len(oldstr)
rever = "" For i = m to 1 step -1
ch = Mid(oldstr, i , 1)
rever = rever & ch
Next reverse = rever
End FunctionSub ShowReverse()
Dim oldstr, newstr
oldstr = InputBox("请输入一个字符串:","字符串翻转")
newstr = reverse(oldstr)
MsgBox "输入的字符串为:" & oldstr & Chr(13) & Chr(10) & "转换后的字符串为:" & newstr
End Sub</SCRIPT>
</HEAD>
<BODY>
<script type="text/vbscript">
call ShowReverse
</script>
……
</BODY>
</HTML>
我用的是sever2003 首先我在记事本写下代码然后保存成asp文件 在ie8输入 localhost/reversestr.asp
<HTML>
<HEAD><TITLE>函数使用举例 反转字符串</TITLE>
<SCRIPT type="text/vbscript">Function reverse(oldstr)
Dim m,rever,ch
m=Len(oldstr)
rever=""
For i = m to 1 step -1
ch = Mid(oldstr,i,l)
rever = rever & ch
Next
reverse = rever
End FunctionSub ShowReverse()
Dim oldstr,newstr
oldstr = InputBox("请输入一个字符串:","字符串翻转")
newstr = reverse(oldstr)
MsgBox "输入的字符串为:" & oldstr & char(13)& chr(10) & "转换后的字符串为:" & newstr
End Sub</SCRIPT>
</HEAD>
<BODY>……
<script type="text/vbscript">
call ShowReverse
</script>
</BODY>
</HTML>
MsgBox "输入的字符串为:" & oldstr & char(13)& chr(10) & "转换后的字符串为:" & newstr chr 拼写错误
汗!
感谢各位学长们的指点哈