欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Windows 腳本宿主  

Character 屬性

報(bào)告某行代碼中包含錯(cuò)誤的特定字符。

Object.Character

參數(shù)

Object
WshRemoteError 對(duì)象。

說(shuō)明

Character 屬性返回一個(gè)帶符號(hào)的長(zhǎng)整型數(shù)。

有些錯(cuò)誤和特定字符位置無(wú)關(guān)。例如,考慮錯(cuò)誤 Expected End If。在這種情況下,沒(méi)有任何行(缺少代碼行)。此時(shí),Character 屬性返回零 (0)。

字符位置按照相對(duì)于位置 (1)(某行中駐留在位置 1 的第一個(gè)字符)的偏移來(lái)確定。

示例

下面的代碼演示 WshRemoteError 對(duì)象如何展示代碼行中有錯(cuò)誤的字符。

[VBScript]
Dim Controller, RemoteScript
Set Controller = WScript.CreateObject("WSHController")
Set RemoteScript = Controller.CreateScript("test.js", "remoteserver")
WScript.ConnectObject RemoteScript, "remote_"
RemoteScript.Execute

Do While RemoteScript.Status <> 2 
    WScript.Sleep 100
Loop

Sub remote_Error
    Dim theError
    Set theError = RemoteScript.Error
    WScript.Echo "Error - Line: " & theError.Line & ", Char: " & theError.Character & vbCrLf & "Description: " & theError.Description
    WScript.Quit -1
End Sub
[JScript]
var Controller = WScript.CreateObject("WSHController");
var RemoteScript = Controller.CreateScript("test.js", "remoteserver");
WScript.ConnectObject(RemoteScript, "remote_");
RemoteScript.Execute();

while (RemoteScript.Status != 2) {
    WScript.Sleep(100);
}

function remote_Error()
{
    var theError = RemoteScript.Error;
    WScript.Echo("Error - Line: " + theError.Line + ", Char: " + theError.Character + "\nDescription: " + theError.Description);
    WScript.Quit(-1);
}

請(qǐng)參閱

WshRemote 對(duì)象 | WshRemoteError 對(duì)象 | Line 屬性| Description 屬性 | SourceText 屬性 | Number 屬性 | Source 屬性