Jump to content

gatting problams in "IniWrite"


 Share

Recommended Posts

$LocNu = GuiCtrlCreateInput(IniRead("Locdata.ini","Save","Open NuConnector","..."),5,40,200,20)
$LocAgbot = GuiCtrlCreateInput(IniRead("Locdata.ini","Save","Open AgBot","..."),5,80,200,20)
$LocSro = GuiCtrlCreateInput(IniRead("Locdata.ini","Save","Open SilkRoad","..."),5,120,200,20)

case $Nuexe
            $Q = "nuConnector914.exe"
            $Title = "Open NuConnector" 
            explorer($Q,$LocNu,$Title)
        case $AGbotexe
            $Q = "AgBot.exe"
            $Title = "Open AgBot" 
            explorer($Q,$LocAgbot,$Title)
        case $Sroexe
            $Q = "Silkroad.exe"
            $Title = "Open SilkRoad" 
            explorer($Q,$LocSro,$Title)

Func explorer($Q,$Link,$Title)
    $OD1 = FileOpenDialog ("" & $Title & "" ,@WindowsDir ,"(" & $Q & ")")
    GUICtrlSetData ($Link ,$OD1)
EndFunc

unc Save($LocNu,$LocAgbot,$LocSro)
    IniWrite("Locdata.ini","Save","Open NuConnector",GUICtrlRead($LocNu))
    IniWrite("Locdata.ini","Save","Open AgBot",GUICtrlRead($LocAgbot)) 
    IniWrite("Locdata.ini","Save","Open SilkRoad",GUICtrlRead($LocSro)) 
EndFunc

after i use explorer func i build it dont save the data in the ini file

pls help ~_~

if yo need the full code tall me and il post

Edited by yakir
Link to comment
Share on other sites

was this a typo?

unc Save($LocNu,$LocAgbot,$LocSro)
    IniWrite("Locdata.ini","Save","Open NuConnector",GUICtrlRead($LocNu))
    IniWrite("Locdata.ini","Save","Open AgBot",GUICtrlRead($LocAgbot)) 
    IniWrite("Locdata.ini","Save","Open SilkRoad",GUICtrlRead($LocSro)) 
EndFunc

or is that how it actually look?

if so try changing unc save to Func save

might be easier to have a look at the whole code.

i dont know much but 2 heads are better then 1.

Link to comment
Share on other sites

here is a demo scrip i made of the problam

#include <GuiConstantsEx.au3>


GuiCreate("AgBot and nuConnector HIDER =]", 255, 225)

$LocNu = GuiCtrlCreateInput(IniRead("Locdata.ini","Save","Open NuConnector","..."),5,40,200,20)
GuiSetState()
MsgBox(0,"","6547852")

$Q = "nuConnector914.exe"
$Title = "Open NuConnector" 
$OD1 = FileOpenDialog ("" & $Title & "" ,@WindowsDir ,"(" & $Q & ")")
GUICtrlSetData ($LocNu ,$OD1)

IniWrite("Locdata.ini","Save","Open NuConnector",GUICtrlRead($LocNu))
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd

after i use FileOpenDialog and then GUICtrlSetData it dosnt save the data why?

if i only use GUICtrlSetData no FileOpenDialog link this :

#include <GuiConstantsEx.au3>


GuiCreate("AgBot and nuConnector HIDER =]", 255, 225)

$LocNu = GuiCtrlCreateInput(IniRead("Locdata.ini","Save","Open NuConnector","..."),5,40,200,20)
GuiSetState()
MsgBox(0,"","6547852")

$Q = "nuConnector914.exe"
$Title = "Open NuConnector" 
$OD1 = "asdfaa"
GUICtrlSetData ($LocNu ,$OD1)

IniWrite("Locdata.ini","Save","Open NuConnector",GUICtrlRead($LocNu))
While GuiGetMsg() <> $GUI_EVENT_CLOSE
WEnd

the problam is here but i have no idea what i do worng

;-------not working------
$Q = "nuConnector914.exe"
$Title = "Open NuConnector" 
$OD1 = FileOpenDialog ("" & $Title & "" ,@WindowsDir ,"(" & $Q & ")")
GUICtrlSetData ($LocNu ,$OD1)

;------- working ----------
$Q = "nuConnector914.exe"
$Title = "Open NuConnector" 
$OD1 = "asdfaa"
GUICtrlSetData ($LocNu ,$OD1)
Link to comment
Share on other sites

  • Developers

FileOpenDialog wil change the working dir and you probably will find your updated ini there.

try:

IniWrite(@scriptdir & "\Locdata.ini","Save","Open NuConnector",GUICtrlRead($LocNu))
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

FileOpenDialog wil change the working dir and you probably will find your updated ini there.

try:

IniWrite(@scriptdir & "\Locdata.ini","Save","Open NuConnector",GUICtrlRead($LocNu))

OMG TYYYY TYYY TYYYY

the need to add this in help file in FileOpenDialog ty alot =] work great now

Link to comment
Share on other sites

  • Developers

the need to add this in help file in FileOpenDialog ty alot =] work great now

Which part is unclear in the helpfile? :(

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.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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