Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error: "The test run cannot continue due to a syntax error. Expected End"
05-06-2011, 04:02 PM
Post: #1
Error: "The test run cannot continue due to a syntax error. Expected End"
Error: "The test run cannot continue due to a syntax error. Expected End"
Quote this message in a reply
05-06-2011, 05:45 PM
Post: #2
Re: Error: "The test run cannot continue due to a syntax error. Expected End"
Check the script for if/else logic that is missing the End if
The script uses incorrect syntax for an if/else block. VBScript requires an "End If" for each if statement used within the script.

Example:
Incorrect Syntax
If rc = 0 then
msgbox "rc =0"
else if rc = 3 then
msgbox "here"
End If

In the above example, there are two "if" statements and only one "end if." Add the missing "end if" lines where needed.

Example:
Corrected syntax
If rc = 0 Then
msgbox "rc =0"
else if rc= 3 then
msgbox "here"
End if
End If

Alternatively, you can remove the space between "else" and "if".

Example:
Corrected syntax
If rc = 0 then
msgbox "rc =0"
elseif rc = 3 then
msgbox "here"
End If
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)