Jump to content

Recommended Posts

Posted

I have the following code:

$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
        Exit
Case $Button
        IniWrite("C:\TKeybind\settings.ini", "Settings", "1", $text1)
Case $Load
        IniRead("C:\TKeybind\settings.ini", "Settings", "1", $text1)
EndSwitch
WEnd

But it wont work :mellow:

  • Moderators
Posted

lawonama,

But it wont work

What does not work? Are you creating the ini file? Do you get the default value when loading? :mellow:

More info please! :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

What is $text1?

Is it a GUI Input control? What are you doing with the read? You're suppose to get a return (and if it can't read it, it'll return whatever $text1 is.)

Posted (edited)

$text1 = GuiCtrlCreateInput("", 10, 10, 290, 20)

I have this. Im writing in the input for example : Hello.

I press SAVE, and when I press LOAD it wont work. It doesn't make a .ini file. I tried to make the .ini file my self. But still it wont write inside.

Its supposed to: Someone writes a text in $text1.

When he presses the save button, it saves to the .ini file.

When he presses the load button, it loads from the .ini file.

Edited by lawonama
  • Moderators
Posted

lawonama,

I suspect it is your OS not allowing you to write to the C:\ drive. :mellow:

Try changing the file path and see if you can write it elsewhere - best practice suggests that "C:\Users\your_name\AppData" is a good place. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Posted

Use GuiCtrlRead($text1) instead of $text1.

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Posted

You are right! It works.. but I wrote at the box : "Hello"..

But in the Settings.ini I see:

[settings]

1=5

I tried also : "asdsada"

and its still

[settings]

1=5

Anyone knows how to fix?

  • Moderators
Posted

lawonama,

Glad my suggestion worked. :mellow:

funkey has given you the answer to your new problem just above. You are currently saving the ControlID of the input, not the content. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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
×
×
  • Create New...