Jump to content
Sign in to follow this  
YoniB

IniWrite - HELP

Recommended Posts

YoniB

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

Share this post


Link to post
Share on other sites
Bundy

Those 2 lines are all from Your script? I'm asking because i can't see any cancel here :D

Share this post


Link to post
Share on other sites
Xenobiologist

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

Share this post


Link to post
Share on other sites
jpm

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

Share this post


Link to post
Share on other sites
Thatsgreat2345

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 by thatsgreat2345

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
YoniB

Thank you all for your replies. At leaset I know now where the ini file "disappeared"... :-)

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.