YoniB Posted June 14, 2006 Share Posted June 14, 2006 Hi! I think there is a BUG!! Here is my code: $var = FileOpenDialog("test", "C:\", "Dat Files (*.DAT)", 1) IniWrite("PackUpdate.ini", "General", "PackPath", $var) Result: If I choose "cancel" - ini file created. If I choose a file - ini file is NOT created :-( Why???? Please help... Link to comment Share on other sites More sharing options...
Bundy Posted June 14, 2006 Share Posted June 14, 2006 Those 2 lines are all from Your script? I'm asking because i can't see any cancel here Link to comment Share on other sites More sharing options...
Xenobiologist Posted June 14, 2006 Share Posted June 14, 2006 HI, I tested it myself. You are right, it is a bit strange, that he doesn't create the ini-file when chosen a file. Return code is 1 = success. $var = FileOpenDialog("test", "C:\", "Dat Files (*.DAT)", 1) MsgBox(0,"",$var) MsgBox(0,"",IniWrite("PackUpdate.ini", "General", "PackPath", $var)) So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
jpm Posted June 14, 2006 Share Posted June 14, 2006 read the doc on FileOpenDialog @WorkingDir is changed on successful return. That the reason why the .ini file is created in the same directory as the choosen file. I don't know why it was implemented this way but it is. From a regression stand point this cannot be changed. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted June 14, 2006 Share Posted June 14, 2006 (edited) why not just pop this in ur script #include <File.au3> $var = FileOpenDialog("test", "C:\", "Dat Files (*.DAT)", 1) If Not Fileexists("PackUpdate.ini") then _Filecreate("PackUpdate.ini") IniWrite("PackUpdate.ini", "General", "PackPath", $var) Else IniWrite("PackUpdate.ini", "General", "PackPath", $var) Endif Edited June 14, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 14, 2006 Share Posted June 14, 2006 (edited) why not just pop this in ur script #include <File.au3> $var = FileOpenDialog("test", "C:\", "Dat Files (*.DAT)", 1) If Not Fileexists("PackUpdate.ini") then _Filecreate("PackUpdate.ini") IniWrite("PackUpdate.ini", "General", "PackPath", $var) Else IniWrite("PackUpdate.ini", "General", "PackPath", $var) Endif Wouldn't that do the same thing, since you are not providing path for "PackUpdate.ini" and the FileOpenDialog() is still changing @WorkingDir? The issue as I understand it (but didn't test), is that the file is being created in an usexpected directory because @WorkingDir was modified. Edit: Clarification Edited June 14, 2006 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
YoniB Posted June 15, 2006 Author Share Posted June 15, 2006 Thank you all for your replies. At leaset I know now where the ini file "disappeared"... :-) 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