Sign in to follow this  
Followers 0
yakir

gatting problams in "IniWrite"

8 posts in this topic

#1 ·  Posted (edited)

$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

Share this post


Link to post
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.

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

any1 can help me plz im stuck 2 days already because of this

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

wan i read this

"@WorkingDir is changed on successful return."

i didnt know what thet meant

it will help for ppl like me you add example under it on what it mean

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  
Followers 0