Jump to content
Sign in to follow this  
CodyBarrett

iniwrite problem.. idk

Recommended Posts

CodyBarrett

ok i have a tcp server im building up on.. i want to have a picture on the server's right hand side of the GUI.. anyway this is my code for shoosing the picture

Func _Change_Display_Picture ()
    $Open_Pic = FileOpenDialog('Display Picture', 'My Pictures','all (*)','','',$GUI)
    GUICtrlSetImage ( $Dis_Pic,$Open_Pic)
    IniWrite('Server.ini','#Server','Display_Picture',' ' & GUICtrlRead($Open_Pic))
EndFunc

and whenever i do this it doenst write to the ini.. it changes the picture but only temporarily... also i been using ini's for a while now and i dont see anything wrong with this i double checked the name and the sections but there isnt anything wrong that i can see, any help you guys?

Share this post


Link to post
Share on other sites
PsaltyDS

ok i have a tcp server im building up on.. i want to have a picture on the server's right hand side of the GUI.. anyway this is my code for shoosing the picture

Func _Change_Display_Picture ()
    $Open_Pic = FileOpenDialog('Display Picture', 'My Pictures','all (*)','','',$GUI)
    GUICtrlSetImage ( $Dis_Pic,$Open_Pic)
    IniWrite('Server.ini','#Server','Display_Picture',' ' & GUICtrlRead($Open_Pic))
EndFunc

and whenever i do this it doenst write to the ini.. it changes the picture but only temporarily... also i been using ini's for a while now and i dont see anything wrong with this i double checked the name and the sections but there isnt anything wrong that i can see, any help you guys?

The variable $Open_Pic contains the string path to the selected file. How are you trying to use that as a control ID in GuiCtrlRead()?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
CodyBarrett

im trying to write the path selected by the user to the ini

Share this post


Link to post
Share on other sites
PsaltyDS

im trying to write the path selected by the user to the ini

Then it should be just:
IniWrite('Server.ini','#Server','Display_Picture', $Open_Pic)

What was the point of having GuiCtrlRead() in there?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
CodyBarrett

nope still doesnt write to the ini

Share this post


Link to post
Share on other sites
PsaltyDS

nope still doesnt write to the ini

Try the full path to the .ini vice just 'Server.ini'.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
CodyBarrett

you mean.. @scriptdir & 'Server.ini' cause ive tried that and still doesnt work

would you like me to post my entire code for the tcp server?(its kinda messy as it is)

Share this post


Link to post
Share on other sites
PsaltyDS

you mean.. @scriptdir & 'Server.ini' cause ive tried that and still doesnt work

would you like me to post my entire code for the tcp server?(its kinda messy as it is)

That should be:
@scriptdir & '\Server.ini'

Note the trailing backslash is not included in the string returned by the macro.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
CodyBarrett

thanks lol why do the backslashes mean different things? i mean its slightly confusing

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  

×