Jump to content

Recommended Posts

Posted

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...

Posted

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

Posted

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. :D

Posted (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.

:D

Edit: Clarification

Edited 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...