Modify

#1828 closed Bug (No Bug)

Strange behavior with IniWrite

Reported by: Tlem Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

Hello, a member of the French forum point us for a strange behavior of the WriteIni command if you use FileOpenDialog before and don't specifies the path of the ini file.

This is the simple test script :

#include <GUIConstants.au3>

Global $Var = "C:\MyDir1\MyDir2\MyDir3\MyFile.exe"

GUICreate('',180,50)
$Button1 = GUICtrlCreateButton("Get File Path", 5, 5, 80, 40)
$Button2 = GUICtrlCreateButton("Write ini", 90, 5, 80, 40)
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            $Var = FileOpenDialog("Select a file", @DesktopDir, "(*.*)")

		Case $Button2
            IniWrite("Test.ini", "Parameters", "Var", $Var)

    EndSwitch
WEnd

If you click "Write ini" button before doing anything else, the file is created.
If you click "Get File Path" button before, the IniWrite action doesn't work ...

After some searches, we have noticed that if we specifies the path of the ini file, the IniWrite action always work ...

The documentation doesn't specifies if the full path of the inifile must be used. So is it a bug or did we miss something?

Attachments (0)

Change History (2)

comment:1 by Jos, on Nov 28, 2010 at 11:04:09 AM

Resolution: No Bug
Status: newclosed

From the Helpfile FileOpenDialog:

Remarks

Separate the file filters with a semicolon as shown in the example.
Multiple groups of filters are separated by a pipe "|".

If default name is given, options must also be given. If none of the options are wanted, use 0 for options.

Special Windows folders (such as "My Documents") can sometimes be set as the init dir; see Appendix.

@WorkingDir is changed on successful return.

comment:2 by Tlem, on Nov 28, 2010 at 8:07:32 PM

I nevertheless read the help of both functions, but I had not dreaded the impact of this little sentence.

Thank you very much.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.