Sign in to follow this  
Followers 0
Roofel

Problem with Ini-funtions:)

4 posts in this topic

#1 ·  Posted (edited)

Hello:) I just needed to know how to handle the Iniread function:)

I figured out how to use Iniwrite and Iniread but everytime i use Iniread it shows up 6 or 7, not the text i made:S

I saw inside the Ini file but there it stands only 6 or 7 so i suspect something is wrong with my use of Iniwrite:S

This is just a a segment out of what im making:)

#include <GuiConstants.au3>

$GUI=GUICreate("Test greier^^,",200,200)
$Load=GUICtrlCreateButton("Load settings", 95,5,100,30)
$Save=GUICtrlCreateButton("Save settings", 95,36,100,30)
$Delete=GUICtrlCreateButton("Delete settings", 95, 67,100,30)
$exit=GUICtrlCreateButton("Exit", 95, 98, 100,30)
$List=GUICtrlCreateInput("", 5, 5, 89, 190)
$Iniread=IniRead(@ScriptDir & "\Settings.ini", "Main", "Data", "")

GUISetState()

While 1
    $msg=GUIGetMsg()
    Select
    Case $msg=$Load
        GUICtrlSetData($List,$Iniread)
    Case $msg=$Save
        IniWrite(@ScriptDir & "\Settings.ini", "Main","Data", $List)
    Case $msg=$Delete
        FileDelete(@ScriptDir & "\Settings.ini")
    Case $msg=$GUI_EVENT_CLOSE Or $msg=$exit
        Exit
    EndSelect
WEnd

Like when i write "Jaha?" and different things in the InputBox it saves it in the Ini file as "Value=7":S And when i load it, it says 7:S Any idea on how to work around this?

Hope you understand

Edited by Roofel

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Share this post


Link to post
Share on other sites



try GuictrlRead()

#include <GuiConstants.au3>

$GUI=GUICreate("Test greier^^,",200,200)
$Load=GUICtrlCreateButton("Load settings", 95,5,100,30)
$Save=GUICtrlCreateButton("Save settings", 95,36,100,30)
$Delete=GUICtrlCreateButton("Delete settings", 95, 67,100,30)
$exit=GUICtrlCreateButton("Exit", 95, 98, 100,30)
$List=GUICtrlCreateInput("", 5, 5, 89, 190)
$Iniread=IniRead(@ScriptDir & "\Settings.ini", "Main", "Data", "")

GUISetState()

While 1
    $msg=GUIGetMsg()
    Select
    Case $msg=$Load
        GUICtrlSetData($List,$Iniread)
    Case $msg=$Save
        IniWrite(@ScriptDir & "\Settings.ini", "Main","Data", GuiCtrlRead($List))
    Case $msg=$Delete
        FileDelete(@ScriptDir & "\Settings.ini")
    Case $msg=$GUI_EVENT_CLOSE Or $msg=$exit
        Exit
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

Thanks Mast3rpyr0:) It worked out nicely and i can finally keep on with my project:)


Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

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