{"name":"lbAdd","operator":null,"title":"lbAdd","type":"command","url":"https://community.bistudio.com/wiki/lbAdd","revid":369231,"updated":"2024-09-03T10:34:56Z","groups":["GUI Control - ListBox"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.75"},{"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.75"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Adds an item with the given text to the CT_LISTBOX or CT_COMBO or CT_TOOLBOX.\n\n> [!NOTE]\n> If using `RscToolBox` as template with ctrlCreate, clear it first with lbClear","syntaxes":[{"syntax":"lbAdd [idc, text]","since":null,"effect":null,"exec":null,"params":[{"name":"idc","type":"Number","optional":false,"default":null,"description":"control IDC","types":["Number"],"since":null,"text":"idc: Number - control IDC"},{"name":"text","type":"String","optional":false,"default":null,"description":"visible text","types":["String"],"since":null,"text":"text: String - visible text"}],"returns":{"type":"Number","types":["Number"],"description":"index (row) of newly added item","text":"Number - index (row) of newly added item"},"form":"unary","operator":null,"left":null,"right":{"text":"[idc, text]","types":["Array"]}},{"syntax":"control lbAdd text","since":null,"effect":null,"exec":null,"params":[{"name":"control","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"control: Control"},{"name":"text","type":"String","optional":false,"default":null,"description":null,"types":["String"],"since":null,"text":"text: String"}],"returns":{"type":"Number","types":["Number"],"description":"index (row) of newly added item","text":"Number - index (row) of newly added item"},"form":"binary","operator":null,"left":{"text":"control","types":["Control"]},"right":{"text":"text","types":["String"]}}],"examples":[{"text":"```sqf\n_index = lbAdd [101, \"First item\"];\n```","code":["_index = lbAdd [101, \"First item\"];"]},{"text":"```sqf\n_index = _control lbAdd \"First item\";\n```","code":["_index = _control lbAdd \"First item\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["lbDelete","lbText"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control - ListBox","Introduced with Operation Flashpoint version 1.75","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}