magician13134 Posted May 24, 2008 Share Posted May 24, 2008 Ok, there may be something totally obvious I'm overlooking here, but this function isn't working, and I'm not sure what's going on... Does anyone see any problems with it?loadBookmarks() Func loadBookmarks($section = "Roots") Local $i Local $temp = IniReadSection("res\bookmarks.ini", $section) If not IsArray($temp) Then MsgBox(0, "Error!", "Could not find file!") For $i = 1 to $temp[0][0] If $temp[$i][1] == "folder" Then MsgBox(0, "", "Found folder: " & $temp[$i][0]) loadBookmarks($temp[$i][0]) Else MsgBox(0, "", $temp[$i][0] & " exists under " & $section) EndIf Next EndFunc ;C:\Users\magician13134\Desktop\msi\software\Vanilla Browser\mockup\ [Roots] Tech=folder Random=folder [Tech] Digg=http://www.digg.com/ Google 42 - The Answer to Everything=http://www.google42.com/ Magic Soft Inc.=http://www.magicsofitnc.com/ [Random] eBay=http://www.ebay.com/ Ladyada=http://www.ladyada.net/ Search Engines=folder New Grounds=http://www.newgrounds.com/ [Search Engines] Yahoo=http://www.yahoo.com/ Excite=http://www.excite.com/ Google=folder [Google] Web=http://www.google.com/ Images=http://images.google.com/ Video=http://video.google.com/ ;C:\Users\magician13134\Desktop\msi\software\Vanilla Browser\mockup\res Anything else I'm overlooking? Thanks Visit Magic Soft Inc. for some of my software Link to comment Share on other sites More sharing options...
Valuater Posted May 24, 2008 Share Posted May 24, 2008 (edited) This worked for me.... Dim $File = @ScriptDir & "\Times.ini" loadBookmarks() Func loadBookmarks($section = "Roots") Local $i Local $temp = IniReadSection($File, $section) If not IsArray($temp) Then MsgBox(0, "Error!", "Could not find file!") For $i = 1 to $temp[0][0] If $temp[$i][1] == "folder" Then MsgBox(0, "", "Found folder: " & $temp[$i][0]) loadBookmarks($temp[$i][0]) Else MsgBox(0, "", $temp[$i][0] & " exists under " & $section) EndIf Next EndFunc I am guessing its your "file location" thats the prob 8) Edited May 24, 2008 by Valuater Link to comment Share on other sites More sharing options...
Valuater Posted May 24, 2008 Share Posted May 24, 2008 (edited) .. anything else??? ...what are you seeing? 8) Edited May 24, 2008 by Valuater Link to comment Share on other sites More sharing options...
magician13134 Posted May 24, 2008 Author Share Posted May 24, 2008 (edited) Huh, still doing what it did before. I'm really puzzled! Although, I added this line of code:If FileExists($File) Then MsgBox(0, "", "File exists...")oÝ÷ Ø Ý¶2È£!£.¥8^uçm+¡×ºÚ"µÍÙÐÞ ][ÝÉ][ÝËÐ^QÜ^J[TXYÙXÝ[Û[YÊ ÌÍÑ[JJJ and it just shows 0 That makes me think my Ini file is wrong... But what you see up there is what I have... Isn't that right? Edited May 24, 2008 by magician13134 Visit Magic Soft Inc. for some of my software Link to comment Share on other sites More sharing options...
MrCreatoR Posted May 24, 2008 Share Posted May 24, 2008 (edited) Does anyone see any problems with it?The only problem that i can predict here, is with relative path (res\bookmarks.ini)... use full path, or set working dir to script dir: loadBookmarks() Func loadBookmarks($section = "Roots") Local $sOld_WorkDir = @WorkingDir FileChangeDir(@ScriptDir) Local $temp = IniReadSection("res\bookmarks.ini", $section) If not IsArray($temp) Then MsgBox(0, "Error!", "Could not find file!") For $i = 1 to $temp[0][0] If $temp[$i][1] == "folder" Then MsgBox(0, "", "Found folder: " & $temp[$i][0]) loadBookmarks($temp[$i][0]) Else MsgBox(0, "", $temp[$i][0] & " exists under " & $section) EndIf Next FileChangeDir($sOld_WorkDir) EndFunc Edited May 24, 2008 by MrCreatoR Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
Valuater Posted May 24, 2008 Share Posted May 24, 2008 The only problem that i can predict here, is with relative path (res\bookmarks.ini)... use full path, or set working dir to script dir:Thats what I thought/said too!8) Link to comment Share on other sites More sharing options...
twitchyliquid64 Posted May 24, 2008 Share Posted May 24, 2008 Huh, still doing what it did before. I'm really puzzled! Although, I added this line of code:If FileExists($File) Then MsgBox(0, "", "File exists...")oÝ÷ Ø Ý¶2È£!£.¥8^uçm+¡×ºÚ"µÍÙÐÞ ][ÝÉ][ÝËÐ^QÜ^J[TXYÙXÝ[Û[YÊ ÌÍÑ[JJJ and it just shows 0 That makes me think my Ini file is wrong... But what you see up there is what I have... Isn't that right? IT is possible the problem lies in the FAT, not the script. Try recreating the INI. If you cannot isolate the problem, try going back to basics, then building from there. Cheers, Hypoz ongoing projects:-firestorm: Largescale P2P Social NetworkCompleted Autoit Programs/Scripts: Variable Pickler | Networked Streaming Audio (in pure autoIT) | firenet p2p web messenger | Proxy Checker | Dynamic Execute() Code Generator | P2P UDF | Graph Theory Proof of Concept - Breadth First search Link to comment Share on other sites More sharing options...
MrCreatoR Posted May 24, 2008 Share Posted May 24, 2008 Thats what I thought/said too!8)Oops, sorry, i just read quickly the first and the last posts magician13134Maby the problem is in the path itself, the @ScriptDir inlude any non-ANSI characters? Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team Link to comment Share on other sites More sharing options...
magician13134 Posted May 24, 2008 Author Share Posted May 24, 2008 (edited) >.< Sorry for wasting you time, guys, I had two Ini files in that folder and I was working with the other one... Guh! On a totally different note here, I love recursion! A year ago, I never could have gotten that working! Edited May 24, 2008 by magician13134 Visit Magic Soft Inc. for some of my software 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