{"name":"comment","title":"comment","type":"command","url":"https://community.bistudio.com/wiki/comment","revid":363597,"updated":"2024-04-07T18:56:13Z","groups":["Strings"],"status":"ok","games":{"ofp":"1.85","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.85","arma3_since":"0.50","description":"Defines a comment. See SQF Syntax - Comments to learn more about comments.\n\n> [!WARNING]\n> This command is evaluated during execution, and as such is infinitely slower than other SQF comment methods (`// comment` or `/* comment */`) which get preprocessed and do not exist at runtime).\n> See SQF Syntax for additional documentation on comments.\n\n> [!NOTE]\n> This command is only used to place comments in unpreprocessed codes, such as trigger On Activation field, object init field, etc.\n> Alternatively, one can use a plain string followed by a semicolon as a way to comment; e.g `\"Some comment\";`.","syntaxes":[{"syntax":"comment text","params":[{"name":"text","type":"String","description":"the comment","type_expr":"String"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"text"}}],"examples":[{"text":"In a preprocessed SQF script (e.g. when doing `execVM \"myScript.sqf\"`)\n\n```sqf\ncomment \"This is a commented line\";        // bad\n\"This is a commented line\";                // slightly better\n// This is a commented line                // perfect\n```","code":["comment \"This is a commented line\";\t\t// bad\n\"This is a commented line\";\t\t\t\t// slightly better\n// This is a commented line\t\t\t\t// perfect"]},{"text":"In an object init field (in editor):\n\n```sqf\ncomment \"This comment works\";\n\"This comment works too\";\n// This doesn't work\n/* This doesn't work either */\n```","code":["comment \"This comment works\";\n\"This comment works too\";\n// This doesn't work\n/* This doesn't work either */"]}],"see_also":["Control Structures"],"notes":[{"user":"Tom_48_97","date":"2009-09-12T19:50:00Z","text":"Like Armed Assault, you can not use brackets to make a multi-lines comment. But, in a sqf file, you can make a comment as follow :\n\n```sqf\ncomment \"\n first line\n seconde line\";\n```"}]}