[This is preliminary documentation and subject to change]
Provides meaningful position information in error messages.
@set @position(end | [file = fname] [, line = lnum] [, column = cnum])
fname
Required if file is used. A string literal containing a valid filename, with or without drive or path information.
lnum
Required if line is used. Any non-negative integer that represents a line of authored code.
cnum
Required if column is used. Any non-negative integer that represents a column in authored code.
Program code written by a JScript author sometimes differs from the actual code being compiled and run. Host environments, such as ASP+, or development tools may emit their own code into the program. This code is generally of no interest to the author, but it has the potential to cause confusion for the author when errors occur.
Instead of correctly identifying the line of the author's code where an error occurred, the compiler may incorrectly identify an error line that doesn't even exist in the original authored code. This is because the additional emitted code has changed the relative position of the author's original code.
In the following example, the line number in a file is changed to accommodate code inserted into the author's code by a JScript host. The line numbers in the left column represent the original source as seen by the user.
01 .. /10 lines of host-inserted code.
.. .. //...
10 .. // End of host-inserted code.
11 .. @set @position(line = 1)
12 01 @set @option(fast);)
13 02 var x = ; // Error reported as being on line 2.
14 03 //Remainder of file.