VBScript compilation error :1033

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
MGuyM
Junior Coder
Posts: 36
Joined: Tue Jul 24, 2007 12:59 am

VBScript compilation error :1033

Post by MGuyM » Tue Jun 24, 2008 10:19 pm

In my Script, I am getting the following Error:

Microsoft VBScript compilation error :1033
Unterminated string constant
Line 13, Column 15

Now, in my Script here is what I have for Line 12-14

Code: Select all

//Load VBScript
VBSTART
VBEND
Now as you might imagine, I'm a little confused what this means.
I don't even know how to Trap Errors in my code.

Help Please... :wink:

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jun 25, 2008 8:20 am

Presumably you have a VBEval line somewhere. The error must be referring to that. Show us your code.

The VBScript line numbers can be confusing. It gives a line in the VBScript code block, but in your case there is no code there, because presumably you have a VBEval statement which evaluates a pure VBScript expression.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MGuyM
Junior Coder
Posts: 36
Joined: Tue Jul 24, 2007 12:59 am

Post by MGuyM » Wed Jun 25, 2008 3:21 pm

Thank You for the speedy reply.

I've narrowed the source of the error.... It's actually happening during the following:

Code: Select all

MidStr>DIV9,4,4,strInvalid
The problem that I've traced with this error is that on this particular page, DIV9 is set to nothing and therefore the error is occuring.

It does however bring up another problem for me....

It appears that while my script is looking to DIV9 for the data, there is something different on the page and DIV9 is actually DIV10 on this particular run. 99% of the time, I'm looking for DIV9 to Extract my Data, but because of an unknown item in the page, DIV9 that I'm looking for is actually DIV10.

Now, my 2 Questions:

1. Is there a way to tell IE_Extract to always get the same piece of Data even if the TAG that references the Data is changed?

2. Is there a way to ignore the error to allow the script to continue?

Thank You so much for your speedy replies.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Jun 25, 2008 4:37 pm

If the page is changing such that there's an extra Div before this one, there's not a lot we can do about that. But you can check to see if the value is empty first:

Code: Select all

Length>DIV9,lenDiv9
If>lenDiv9>0
  MidStr>DIV9,4,4,strInvald
Else
 ...
Endif
Perhaps you might grab DIV10 if DIV9 returns empty. Or perhaps there's something in the text that is returned from DIV9 that can be used to verify you have the right value. You could then cycle through all DIVs until you find the right pattern.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

MGuyM
Junior Coder
Posts: 36
Joined: Tue Jul 24, 2007 12:59 am

Post by MGuyM » Wed Jun 25, 2008 5:48 pm

OK, I implemented what you suggested above and my Macro looped a few more times, then it failed again because the information I was looking for in DIV9 and now DIV10 has moved again to DIV11.

While I know I could do a Check Look, what I'm looking for is a String of Numbers IE. (##,###,###). They are whole Numbers and while these numbers exist in various tags, using Web Recorder, I have been able to isolate the specific tag that contains just the number and I'm trying to strip out the commas that the number contains so I can get a raw number and write this number to a log file.

Is there a way to determine the total number DIV Statements and maybe I could just loop through all the DIV statements and maybe do some kind of a comparison to look for just the Number.

I'm feeling a little lost can you tell....

Thank You so much for all your valuable help.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts