在ASP中声明变量时出错

use*_*224 2 asp-classic

我在经典ASP中以这种方式声明了一个字符串变量:

Dim i As String
Run Code Online (Sandbox Code Playgroud)

并收到此错误:

Microsoft VBScript compilation error '800a0401' 

Expected end of statement
/retencion/Estadisticas/Detail.asp, line 10, column 6

Dim i As String
-----^

这是为什么?

Ama*_*ere 7

经典ASP是用VBScript编写的,不是Visual Basic本身,因此不能将事物声明为字符串.松散打字我认为是描述它的短语.基本上,你必须省略"as"及其之后的任何内容.

尝试:

<%
Dim i

'you can now use the variable as you want.
i = "whatever"
%>
Run Code Online (Sandbox Code Playgroud)