Jump to content

Iniread in Inputbox problem


Recommended Posts

Hi guys, here's an easy one for you that I just dont know where to look......

In my GUI I have some input boxes, inputs get written to an .ini file - no problems there. What I cant seem to do is when the GUI is opened each time the "default" (previously inputted data), will not show up in the input boxes.

Can you help me please?

Sorry no script but I'm suspecting this can be done in 1 or 2 lines....

Thanks.

Link to comment
Share on other sites

Hi guys, here's an easy one for you that I just dont know where to look......

In my GUI I have some input boxes, inputs get written to an .ini file - no problems there. What I cant seem to do is when the GUI is opened each time the "default" (previously inputted data), will not show up in the input boxes.

Can you help me please?

Sorry no script but I'm suspecting this can be done in 1 or 2 lines....

Thanks.

Read the data with

$string = IniRead($inifilename,$section,$variable,$defaultValue)

write the data to the input box with

GUICtrlSetData($EditBox,$string)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Moderators

If IniRead("C:/MyIniFile","Saved Data","CheckBox",0) = 1 Then GUICtrlSetState($MyCheckBox,$GUI_CHECKED)
You may find that this statement will never be true. IniRead() returns a string, you have it checking for an integer.

Edit:

(Besides the fact that "C:/MyIniFile" is incorrect :rolleyes: )

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

can the script find out how many sections, keys, values in the ini file?

for example this ini file

[test section-1]
test key-1 = test valu-1

[test section-2]
test key-1 = test valu-2

[test section-3]
test key-1 = test valu-3

I want the script to tell me the ini file has 3 sction

and a MsgBox with Detail

I just can't figure this out

Edited by star2

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

Link to comment
Share on other sites

still didn't like the example in the help file

maby cause I'm having a very bad Headache

[quote]Baby you're all that I want, When you're lyin' here in my armsI'm findin' it hard to believe, We're in heavenAnd love is all that I need , And I found it there in your heartIt isn't too hard to see, We're in heaven .Bryan Adams[/quote].............................................................................[u]AUTOIT[/u]

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