Sign in to follow this  
Followers 0
tobi2006

Why is there "0" in the ComboBox?

6 posts in this topic

$loadname2 = FileOpenDialog("Load Ini-File...", @ScriptDir & "\", "Ini (*.ini)", 1 + 4 )



$line1= IniReadSection($loadname2,"Color")
$line2= IniReadSection($loadname2,"Size")
$line3= IniReadSection($loadname2,"Bg-Color")

_GUICtrlComboBox_SetEditText($Combo1, $line1)
_GUICtrlComboBox_SetEditText($Combo2, $line2)
_GUICtrlComboBox_SetEditText($Combo3, $line3)

Why is there "0" in the ComboBox?

Share this post


Link to post
Share on other sites



$loadname2 = FileOpenDialog("Load Ini-File...", @ScriptDir & "\", "Ini (*.ini)", 1 + 4 )



$line1= IniReadSection($loadname2,"Color")
$line2= IniReadSection($loadname2,"Size")
$line3= IniReadSection($loadname2,"Bg-Color")

_GUICtrlComboBox_SetEditText($Combo1, $line1)
_GUICtrlComboBox_SetEditText($Combo2, $line2)
_GUICtrlComboBox_SetEditText($Combo3, $line3)

Why is there "0" in the ComboBox?

You need to give the elements of the arrays you want in the comboboxes, or maybe you didn't want IniReadSection.

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.

Share this post


Link to post
Share on other sites

$loadname2 = FileOpenDialog("Load Ini-File...", @ScriptDir & "\", "Ini (*.ini)", 1 + 4 )



$line1= IniReadSection($loadname2,"Color")
$line2= IniReadSection($loadname2,"Size")
$line3= IniReadSection($loadname2,"Bg-Color")

_GUICtrlComboBox_SetEditText($Combo1, $line1)
_GUICtrlComboBox_SetEditText($Combo2, $line2)
_GUICtrlComboBox_SetEditText($Combo3, $line3)

Why is there "0" in the ComboBox?

iniReadSection

Success: Returns a 2 dimensional array where element[n][0] is the key and element[n][1] is the value

It's because $line1 & $line2 & $line3 are arrays.

[sub]Quantum mechanics: The dreams stuff is made of[/sub]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

CODE

Orange

18

[bg-Color]

Green

That's my ini-file.

No values.

Edited by tobi2006

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

That is not a properly formated INI.

Try something like this:

[Settings]
Color=Orange
Size=18
BgColor=Green

$INIData = IniReadSection($loadname2,"Settings")
$line1= $INIData[1][1]
$line2=  $INIData[2][1]
$line3= $INIData[3][1]
Edited by DarkMatter

[sub]Quantum mechanics: The dreams stuff is made of[/sub]

Share this post


Link to post
Share on other sites

It works! Thanks!

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