声明具有所需数据类型的任何变量时出现 VbScript 错误

声明具有所需数据类型的任何变量时出现 VbScript 错误

问题描述:

在我的 .VBS 文件中,每当使用任何此类声明时,我都会收到错误.为什么会这样,有什么想法吗?

In my .VBS file, whenever using any such declaration, I am getting error.Why so,any ideae?

Option Explicit

Dim vString as String

错误是:预期的语句结束"

Error is : "Expected end of Statement"

我无法声明任何具有所需数据类型的变量.

I could not declare any variable with its required data types.

在 VBScript 中只有变体,所以它会是 Dim vString(删除 As String)

In VBScript there is only variants so it would be Dim vString (remove the As String)