NELyon Posted July 18, 2006 Share Posted July 18, 2006 (edited) #include <GUIConstants.au3> global $number $Snippets = GUICreate("Snippets", 411, 465, 189, 114) $List1 = GUICtrlCreateList(INIRead("snippets.ini", "snippets", $number, ""), 0, 0, 409, 292, -1, $WS_EX_CLIENTEDGE) $Add = GUICtrlCreateButton("Add", 144, 304, 105, 49) $Clipboard = GUICtrlCreateButton("Clipboard", 144, 400, 105, 49) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Add $addbox = InputBox("Add Snippet", "Type in the code you want to save") GUICtrlSetData($List1, $addbox) INIWrite("snippets.ini", "snippets", $number + 1, $addbox) EndSelect WEnd Exit Does anyone know why this won't re-read the stuff in the INI? it will also overwrite the ini each time, replacing 1=anything with 1=other thing and not making a 2=anything EDIT: I know the clipboard part has no function yet. still in progress Edited July 18, 2006 by codemyster Link to comment Share on other sites More sharing options...
GaryFrost Posted July 18, 2006 Share Posted July 18, 2006 #include <GUIConstants.au3> global $number $Snippets = GUICreate("Snippets", 411, 465, 189, 114) $List1 = GUICtrlCreateList(INIRead("snippets.ini", "snippets", $number, ""), 0, 0, 409, 292, -1, $WS_EX_CLIENTEDGE) $Add = GUICtrlCreateButton("Add", 144, 304, 105, 49) $Clipboard = GUICtrlCreateButton("Clipboard", 144, 400, 105, 49) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Add $addbox = InputBox("Add Snippet", "Type in the code you want to save") GUICtrlSetData($List1, $addbox) INIWrite("snippets.ini", "snippets", $number + 1, $addbox) EndSelect WEnd Exit oÝ÷ ÚÈhºW[y«¢+Ø)±½°ÀÌØí¹ÕµÈôÄ( start from there. btw your working with a listbox not a listview SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
NELyon Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) now it does the same thing, but with two. i tried adding this: ;right after the inputbox $number + 1 but i get a syntax error. also, does anyone know why it won't read the INI? Edited July 18, 2006 by codemyster Link to comment Share on other sites More sharing options...
GaryFrost Posted July 18, 2006 Share Posted July 18, 2006 i would suggest researching IniReadSection and adapting that to what your trying to do for the read. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
NELyon Posted July 18, 2006 Author Share Posted July 18, 2006 Ok, so i have this. But all it does is return how many keys are in the INI #include <GUIConstants.au3> global $number = 1 $var = IniReadSection("snippets.ini", "snippets") $Snippets = GUICreate("Snippets", 411, 465, 189, 114) $List1 = GUICtrlCreateList($var[0][0], 0, 0, 409, 292, -1, $WS_EX_CLIENTEDGE) $Add = GUICtrlCreateButton("Add", 144, 304, 105, 49) $Clipboard = GUICtrlCreateButton("Clipboard", 144, 400, 105, 49) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Add $addbox = InputBox("Add Snippet", "Type in the code you want to save") GUICtrlSetData($List1, $addbox) INIWrite("snippets.ini", "snippets", $number + 1, $addbox) EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
GaryFrost Posted July 18, 2006 Share Posted July 18, 2006 Now that you've "Glanced" at the IniReadSection You'll want to read up on For Next SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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