Jump to content

removed


stuka
 Share

Recommended Posts

I was trying to use FileOpenDialog to tell IniRead which file to read... maybe wrong usage. But is there another better way to do this?

$key = iniread(@scriptdir&"/setting.ini", "section", "key", "default")

As I said in the first post. You don't use FileOpenDialog with iniread. Just use iniread to get your key.

Link to comment
Share on other sites

But I'm using FileOpenDialog to select which inf file I would like IniRead to read...

So that a user can browse for any inf files and choose it...i'm not using it for an .ini settings file...

I'm sorry, I misunderstood. OK, I tried the following to see if this would work, and it worked fine for me. I put in a msgbox to see if FileOpenDialog would show the path to the inf file first.

$openvar = FileOpenDialog("test", @HomeDrive, "Inf File (*.inf)", 1)
$inivar1 = IniRead($openvar, "autorun", "open", "0")
MsgBox(0, $inivar1, $openvar);returned path and the key. I made a inf file and it found it.
If @error Then
    Exit
Else
$inivar = IniRead($openvar, "autorun", "open", "0")
If $inivar = 0 Then
    MsgBox(4096,"","No such key")
Else
    MsgBox(4096,"","Key found!") 
EndIf
EndIf

Now, I coded my inf file like this:

[Autorun]

open=software.exe

Is your coded like this? you may want to check that.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...