Hmmm. Tricky one.

It is actually reporting the correct line. The problem is that there is a bit of information missing, and a bit of information which is misleading.

The reason it is so confusing is that the error is occurring in the Executed() code, *not* the test.kix code.

The code in the Execute() is has it's own context including line numbers, and your error is occurring on line 1 of the executed code.

Try the following example:
 Code:
"Line 1" ?
"Line 2" ?
$=Execute("'foo' ?"+@CRLF+"$x="+$y)


Now you will find that KiXtart (correctly) reports the error on line 2.

Think of Execute() as being a little like CALLing another script and the reason for the confusion becomes clearer.

The big problem is that the error message says that the error is in "test.kix". Although that is true, it is also very misleading. If the error message said that the error was in "executed code" at least it would point you in the right direction.

The best solution would be some sort of callback trace displaying the return stack, something like:
 Code:
ERROR : Error in expression.!
Script: Executed() Code
Line  : 2
Script: C:\svn\scripts\test.kix
Line  : 3