{"name":"comment","operator":null,"title":"comment","type":"command","url":"https://community.bistudio.com/wiki/comment","revid":363597,"updated":"2024-04-07T18:56:13Z","groups":["Strings"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.85"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofp","name":"Operation Flashpoint","version":"1.85"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"text","type":"String","optional":false,"default":null,"description":"the comment","types":["String"],"since":null,"text":"text: String - the comment"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"unary","operator":null,"left":null,"right":{"text":"text","types":["String"]}}],"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 */"]}],"multiplayer":null,"problems":null,"aliases":[],"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```"}],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Strings","Introduced with Operation Flashpoint version 1.85","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}