When an error makes no sense

From Bohemia Interactive Community
Revision as of 08:06, 18 August 2008 by General Barron (talk | contribs) (This issue comes up a lot for me, hopefully it will help others who may be frustrated too)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sometimes, the displayed error will not appear to be correct. The error parser will point you to a line of code which is correct, yet it will tell you that some strange error exists at that point.

In this case, the problem usually lies beneath that point in the code. Usually the source of the error is actually a missing parenthesis, bracket, curly brace, etc.


Compatibility:

This only applies to .sqf syntax scripts, not .sqf scripts.


Example:

for "_i" from 0 to 1 do
{
	_str = format["mystring";
};

In this example, the error will be shown to originate just to the left of the word "do". However, the error is actually caused by a line in the code beneath the do statement. (Such an error would be difficult to spot if it were many more lines down in the code)