Modify

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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 Changed 14 years ago by Jos

  • Resolution set to No Bug
  • Status changed from new to closed

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 Changed 14 years ago by Tlem

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

Thank you very much.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.