Odd Plugin Error

Posted by NeoFryBoy on Sat 24 Jun 2006 07:17 AM — 2 posts, 11,906 views.

USA #0
Not sure this is a bug yet, so I'm posting it here.

I loaded a plugin, and it returned this error

Error number: -2146827263
Event:        Execution of line 145 column 30
Description:  Expected end of statement
Line in error: 
 world.ansinote ansi(31) & ansi(1) & "You're out of " & world.getvariable("chpot") & "(s)!!!"
Called by:    Immediate execution


I've been staring at it fer the past twenty minutes and see nothing wrong with it. As you can see it's failing on the first semicolon, and when I put it into the command box and replace the & with & it runs perfectly fine.

It's in the script section of the plugin on a line of it's own.

Also, how exactly does the error engine determine waht line is failing? I made a script that numbers each line, and that line is on line 467 in the plugin, and line 4 of the scripts block.
Australia Forum Administrator #1
If you are using the CDATA blocks (which it sounds like you probably are) then you don't need to turn & into &.

In other word, this is OK:


<script>
<![CDATA[

AnsiNote ANSI(31) & ANSI(1) & "You're out of " & GetVariable("chpot") & "(s)!!!"

]]>
</script>


However if you don't use CDATA then you need to do it, so it would look like this:


<script>
AnsiNote ANSI(31) &amp; ANSI(1) &amp; "You're out of " &amp; GetVariable("chpot") &amp; "(s)!!!"
</script>


Quote:

Also, how exactly does the error engine determine waht line is failing?


If you have this line (which the plugin wizard normally adds):


<include name="constants.vbs"/>


... then the line numbers will be out by the number of lines in that file (149 in my copy).