ashley Posted November 13, 2008 Share Posted November 13, 2008 Ok well... I have it made it save... but how do I make it load the stuff? And it must load different things on different dates... here is my code: expandcollapse popup#include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> ; $'s and global's: $File = FileRead(@ScriptDir & "Dairyfile.mdf") $fileopen = FileOpen($File, 1) $Fileclose = FileClose($File) If FileExists("Dairyfile.mdf") then Sleep(1000) Else FileWrite("Dairyfile.mdf","") EndIf #Region ### START Koda GUI section ### Form= $Calander = GUICreate("Calander", 724, 550) $MonthCal1 = GUICtrlCreateMonthCal("", 8, 8, 231, 164) $Progress1 = GUICtrlCreateProgress(8, 176, 230, 17) ;Daily notes $DNLabel = GUICtrlCreateLabel("Daily notes", 8, 200, 233, 17) $Dailynotes = GUICtrlCreateEdit("", 8, 220, 233, 280) GUICtrlSetData(-1, "") $savebutton = GUICtrlCreateButton("Save", 8, 505, 60, 25) $loadbutton = GUICtrlCreateButton("Load", 70, 505, 60, 25) ;AM $AMLabel = GUICtrlCreateLabel("AM", 248, 8, 36, 17) $AM = GUICtrlCreateEdit("", 248, 25, 465, 130) GUICtrlSetData(-1, "") ;PM $PMLabel = GUICtrlCreateLabel("PM", 248, 158, 36, 17) $PM = GUICtrlCreateEdit("", 248, 175, 465, 130) GUICtrlSetData(-1, "") ;EVE $EVELabel = GUICtrlCreateLabel("EVE", 248, 308, 36, 17) $EVE = GUICtrlCreateEdit("", 248, 325, 465, 130) GUICtrlSetData(-1, "") ;Family $Familytab = GUICtrlCreateTab(248, 460, 475, 88) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("Karen ") GUICtrlSetState(-1,$GUI_SHOW) $Karennotes = GUICtrlCreateEdit("", 250, 485, 468, 60) GUICtrlSetData(-1, "") $TabSheet2 = GUICtrlCreateTabItem("Ash ") $Ashnotes = GUICtrlCreateEdit("", 250, 485, 468, 60) GUICtrlSetData(-1, "") $TabSheet3 = GUICtrlCreateTabItem("Josh ") $Joshnotes = GUICtrlCreateEdit("", 250, 485, 468, 60) GUICtrlSetData(-1, "") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $loadbutton Case $savebutton FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($Dailynotes)) FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($AM)) FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($PM)) FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($EVE)) FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($Karennotes)) FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($Ashnotes)) FileWriteLine("Dairyfile.mdf", "" & GUICtrlRead($Joshnotes)) EndSwitch WEnd Thanks in advance... and yeah it is personalised to my family atm... Free icons for your programs Link to comment Share on other sites More sharing options...
evilertoaster Posted November 13, 2008 Share Posted November 13, 2008 (edited) I think your save code doesn't save all the nessicary information to allow for loading... I'm guessing you want to mark the date and save/load based on which day is selected right? Edited November 13, 2008 by evilertoaster Link to comment Share on other sites More sharing options...
ashley Posted November 13, 2008 Author Share Posted November 13, 2008 Yeah, so its like a dairy:) Free icons for your programs Link to comment Share on other sites More sharing options...
Aceguy Posted November 14, 2008 Share Posted November 14, 2008 (edited) when saving you really need to keep all the data for that entry on one line.... like FileWriteLine("Dairyfile.mdf", GUICtrlRead($Dailynotes) &"|"& GUICtrlRead($AM)&"|"& "whatever" & "more info") remebering to add a | between each entry.... so then you can Case $loadbutton _FileReadToArray(.... ect) then search the array for what you want, day ect.... then stringsplit the array with the delimiter "|" and then display the results.. Edited November 14, 2008 by Aceguy [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...
ashley Posted November 14, 2008 Author Share Posted November 14, 2008 ok, so i have this? expandcollapse popup#include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <ProgressConstants.au3> #include <WindowsConstants.au3> ; $'s and global's: $File = FileRead(@ScriptDir & "Dairyfile.mdf") $fileopen = FileOpen($File, 1) $Fileclose = FileClose($File) If FileExists("Dairyfile.mdf") then Sleep(1000) Else FileWrite("Dairyfile.mdf","") EndIf #Region ### START Koda GUI section ### Form= $Calander = GUICreate("Calander", 724, 550) $MonthCal1 = GUICtrlCreateMonthCal("", 8, 8, 231, 164) $Progress1 = GUICtrlCreateProgress(8, 176, 230, 17) ;Daily notes $DNLabel = GUICtrlCreateLabel("Daily notes", 8, 200, 233, 17) $Dailynotes = GUICtrlCreateEdit("", 8, 220, 233, 280) GUICtrlSetData(-1, "") $savebutton = GUICtrlCreateButton("Save", 8, 505, 60, 25) $loadbutton = GUICtrlCreateButton("Load", 70, 505, 60, 25) ;AM $AMLabel = GUICtrlCreateLabel("AM", 248, 8, 36, 17) $AM = GUICtrlCreateEdit("", 248, 25, 465, 130) GUICtrlSetData(-1, "") ;PM $PMLabel = GUICtrlCreateLabel("PM", 248, 158, 36, 17) $PM = GUICtrlCreateEdit("", 248, 175, 465, 130) GUICtrlSetData(-1, "") ;EVE $EVELabel = GUICtrlCreateLabel("EVE", 248, 308, 36, 17) $EVE = GUICtrlCreateEdit("", 248, 325, 465, 130) GUICtrlSetData(-1, "") ;Family $Familytab = GUICtrlCreateTab(248, 460, 475, 88) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("Karen ") GUICtrlSetState(-1,$GUI_SHOW) $Karennotes = GUICtrlCreateEdit("", 250, 485, 468, 60) GUICtrlSetData(-1, "") $TabSheet2 = GUICtrlCreateTabItem("Ash ") $Ashnotes = GUICtrlCreateEdit("", 250, 485, 468, 60) GUICtrlSetData(-1, "") $TabSheet3 = GUICtrlCreateTabItem("Josh ") $Joshnotes = GUICtrlCreateEdit("", 250, 485, 468, 60) GUICtrlSetData(-1, "") GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $loadbutton _FileReadToArray("Dairyfile.mdf", What goes here?) Case $savebutton FileWriteLine("Dairyfile.mdf", GUICtrlRead($Dailynotes) & "|" & GUICtrlRead($AM) & "|" & GUICtrlRead($PM) & "|" & GUICtrlRead($EVE) & "|" & GUICtrlRead($Karennotes) & "|" & GUICtrlRead($Ashnotes) & "|" & GUICtrlRead($Joshnotes) & "|") EndSwitch WEnd What goes in the load bit... and how do i get it to load dioffrent things on difffrent dates? Free icons for your programs Link to comment Share on other sites More sharing options...
AzKay Posted November 14, 2008 Share Posted November 14, 2008 Might want to look at the Ini* functions. Might be a tad easier, if not, neater. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
ashley Posted November 14, 2008 Author Share Posted November 14, 2008 huh??? Free icons for your programs Link to comment Share on other sites More sharing options...
ashley Posted November 15, 2008 Author Share Posted November 15, 2008 ... Free icons for your programs Link to comment Share on other sites More sharing options...
Aceguy Posted November 18, 2008 Share Posted November 18, 2008 _FileReadToArray("Dairyfile.mdf", What goes here?) _FileReadToArray("Dairyfile.mdf", $data);assigns the read data, to the variable $data _array display($data); you can see the $data values [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