Aceguy Posted June 13, 2006 Share Posted June 13, 2006 Cant Figure out how to save the data in the list. expandcollapse popup#include <GUIConstants.au3> dim $IniFile = @DesktopDir & "\recipies.ini" $myGui=GUICreate("Test Prg v1.0",400,500) $Add=GUICtrlCreateButton("Add Inputs",10,450,75,25) $save=GUICtrlCreateButton("Save",200,450,75,25) $Input_1=GUICtrlCreateInput("input1",10,420,50,25) $Input_2=GUICtrlCreateInput("input2",70,420,50,25) $Input_3=GUICtrlCreateInput("input4",130,420,50,25) $Input_4=GUICtrlCreateInput("input4",190,420,50,25) $listview = GUICtrlCreateListView("Input1|Input2|Input3|Input4|", 10, 10, 380, 350) $inientry = IniReadSection($IniFile, "yagudo drink") If Not IsArray($inientry) Then MsgBox(0, "", "No Entry") Else For $i = 1 To $inientry[0][0] GUICtrlCreateListViewItem($inientry[$i][1], $listview) Next EndIf GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Add $read1=GUICtrlRead($Input_1) $read2=GUICtrlRead($Input_2) $read3=GUICtrlRead($Input_3) $read4=GUICtrlRead($Input_4) GuiCtrlCreateListViewItem($read1 & "|" & $read2 & "|" & $read3 & "|" & $read4 & "|", $listView) case $msg = -3 ExitLoop Case $msg = $save EndSelect WEnd Please Help, many thanks. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 13, 2006 Moderators Share Posted June 13, 2006 (edited) LOL... we don't have the list to check Edit:.... I'm feeling like an today... hope you didn't read what I posted before The list items are stored in the $inientry array, and to read a list view you would need to use the _GUICtrlListViewGetItemTextArray() or something to store the items in an array... I don't play with this function enough to give you "good" answer, sorry. Edited June 13, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted June 13, 2006 Share Posted June 13, 2006 as Smoke said with out the file to reference the key names it's just a guess expandcollapse popup#include <GUIConstants.au3> #include <GuiListView.au3> Dim $IniFile = @DesktopDir & "\recipies.ini" $myGui = GUICreate("Test Prg v1.0", 400, 500) $Add = GUICtrlCreateButton("Add Inputs", 10, 450, 75, 25) $save = GUICtrlCreateButton("Save", 200, 450, 75, 25) $Input_1 = GUICtrlCreateInput("input1", 10, 420, 50, 25) $Input_2 = GUICtrlCreateInput("input2", 70, 420, 50, 25) $Input_3 = GUICtrlCreateInput("input4", 130, 420, 50, 25) $Input_4 = GUICtrlCreateInput("input4", 190, 420, 50, 25) $listview = GUICtrlCreateListView("Input1|Input2|Input3|Input4|", 10, 10, 380, 350) $inientry = IniReadSection($IniFile, "yagudo drink") If Not IsArray($inientry) Then MsgBox(0, "", "No Entry") Else For $i = 1 To $inientry[0][0] GUICtrlCreateListViewItem($inientry[$i][1], $listview) Next EndIf GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Add $read1 = GUICtrlRead($Input_1) $read2 = GUICtrlRead($Input_2) $read3 = GUICtrlRead($Input_3) $read4 = GUICtrlRead($Input_4) GUICtrlCreateListViewItem($read1 & "|" & $read2 & "|" & $read3 & "|" & $read4 & "|", $listview) Case $msg = -3 ExitLoop Case $msg = $save For $x = 0 To _GUICtrlListViewGetItemCount($listview) - 1 IniWrite($IniFile, "yagudo drink", $x, _GUICtrlListViewGetItemText($listview, $x)) Next EndSelect WEnd 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...
Aceguy Posted June 14, 2006 Author Share Posted June 14, 2006 thanks guys, sometimes the obvious to you is not the obvious to me...... LOL, if that makes sense. thanks for your reply, it works a treat. You guys are soo good, /salute. [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock 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