DenVdmj 0 Posted November 10, 2011 I understand that they may be valid in terms of semantics, but is there any real need to write ((( for "_i" ) from 10 ) to 12 ) do { player sideChat str _i } instead of justfor "_i" from 10 to 12 do { player sideChat str _i }? Formally, this is the correct code. Respectively, checker (formally correct checker) should recognize it as valid. (otherwise, what is the profit of checking?) In SQF every command has one of the three basic syntactic forms. Most of the commands more correctly be called "operators", and below we see why. 1) No-operand form, either a constant, such as "west", "pi", or "access function" such as "player", "overcast". 2) Single operand from, such as unary operators "-", "not" in Pascal or operators "!", "new", "delete" in C++. In SQF it is a "if", "switch", "for", unary "-", "!", "not", and others. 3) Two-operands form, operators such as "*", "/", "or", "and" of Pascal. In SQF, this syntactic group includes follows operators: "then", "else", "do", "from", "to", "*", "/", "&&", "and", "||", "or", and others. What is my point: SQF has little to do with us habitual programming languages. And if in other languages "if then else" - is the basic syntax, then in the SQF is a just expression, wich syntactically no different from the "! ((Pi / 6) == (someVar * 120))" There are many other differing languages, such as Forth, LISP, Haskel, etc. We can't be consider that is only one scripting style is right style, style that more similar to C way, but less to the LISP way (for example). The maximum, that can afford code checker, it is warnings only: "your code doesn't look like the C++ code!". Share this post Link to post Share on other sites
diraven 10 Posted November 11, 2011 Well I want my checker at least make sure user did not type if (***) {asdf} (without "then" keyword). I.e. check at least some basical errors. If there is no real situation where you would write ((( for "_i" ) from 10 ) to 12 ) do { player sideChat str _i } - I'm not sure if I should disable the "if-then-else" correctness checks just to allow statements like above one. Turning it off basically would mean just turning off the spellchecker. With the same profit you would just ignore it's warnings. Share this post Link to post Share on other sites