{"name":"When an error makes no sense","title":"When an error makes no sense","type":"topic","url":"https://community.bistudio.com/wiki/When_an_error_makes_no_sense","revid":376119,"updated":"2025-08-31T21:26:20Z","aliases":[],"markdown":"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.\n\nIn this case, the problem usually lies **beneath** that point in the code.\nUsually the source of the error is actually a **missing parenthesis, bracket, curly brace, etc.**\nUsually the error message says that it encountered a string where it expected code.\n\n**Compatibility:**\n\nThis only applies to SQF Syntax scripts, not SQS scripts.\n\n**Example:**\n\n```sqf\nfor \"_i\" from 0 to 1 do\n{\n    _str = format [\"mystring\", _i;\n};\n```\n\nIn this example, the error will be shown to originate just to the left of the word \"do\".\nHowever, the error is actually caused by a line in the code beneath the do statement\n(such an error would be difficult to spot if it were many more lines down in the code).","sections":[{"heading":null,"level":1,"markdown":"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.\n\nIn this case, the problem usually lies **beneath** that point in the code.\nUsually the source of the error is actually a **missing parenthesis, bracket, curly brace, etc.**\nUsually the error message says that it encountered a string where it expected code.\n\n**Compatibility:**\n\nThis only applies to SQF Syntax scripts, not SQS scripts.\n\n**Example:**\n\n```sqf\nfor \"_i\" from 0 to 1 do\n{\n    _str = format [\"mystring\", _i;\n};\n```\n\nIn this example, the error will be shown to originate just to the left of the word \"do\".\nHowever, the error is actually caused by a line in the code beneath the do statement\n(such an error would be difficult to spot if it were many more lines down in the code)."}],"categories":["Common Scripting Errors"],"groups":["Scripting"]}