sneakysmith12 Posted November 15, 2006 Share Posted November 15, 2006 How do I delete an item from a list at any position in the list.Where the user would type happy birthdayand it would be removed from the following listcookieshappy birthdaycakeice creamplease helpthanksand yes this is my first post... ever Yeah I'm not the greatest at DarkBasic either, but I'm good enough for a link :D A Thread of a W.I.P. that im making Link to comment Share on other sites More sharing options...
PaulIA Posted November 15, 2006 Share Posted November 15, 2006 Welcome to the forum. It really depends on what type of list you are using. Is the list an array in memory, in a control or a file? Do you know the position of what you want to delete ahead of time or do you need to be able to search the list and delete it? Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
sneakysmith12 Posted November 15, 2006 Author Share Posted November 15, 2006 (edited) they syntax is read as listed... please bare with me as im doing this off of memory as im at school it does run completly, just not how i want it to, when i have code correct... #include <guicontrol.au3> #include <Guilist.au3> #include <xscript.au3> $list = GUICtrlCreateList("",100,100...etc) ;then i am trying to use While 1 Wend func add() $add = xctrlinputbox("Something","else","") _GuiCtrlListInsertItem($list,$add) func remove() ;not sure if thats exact command $remove = Xctrlinputbox("something","else","") _GuiCtrlListDeleteItem($list,$remove) please help me thanks much more I need to be able to search the list and then delete it. Edited November 15, 2006 by sneakysmith12 Yeah I'm not the greatest at DarkBasic either, but I'm good enough for a link :D A Thread of a W.I.P. that im making Link to comment Share on other sites More sharing options...
PaulIA Posted November 15, 2006 Share Posted November 15, 2006 Here's a simple example to get you started: #include <GUIConstants.au3> #include <GUIList.au3> GUICreate("Test", 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) $hList = GUICtrlCreateList("", 4, 4, 342, 292, BitOr($LBS_NOTIFY, $WS_VSCROLL, $WS_BORDER)) GUISetState () for $I = 1 to 5 _GUICtrlListAddItem($hList, "Item " & $I) next _GUICtrlListAddItem($hList, "Find Me") for $I = 6 to 10 _GUICtrlListAddItem($hList, "Item " & $I) next MsgBox(0, "Test", "Loaded") $N = _GUICtrlListFindString($hList, "Find Me") _GUICtrlListDeleteItem($hList, $N) do Sleep(100) until GUIGetMsg() = $GUI_EVENT_CLOSE Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
sneakysmith12 Posted November 15, 2006 Author Share Posted November 15, 2006 Thanks very much Yeah I'm not the greatest at DarkBasic either, but I'm good enough for a link :D A Thread of a W.I.P. that im making Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now