Jump to content

Why is there "0" in the ComboBox?


Recommended Posts

$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?

Link to comment
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.
Link to comment
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]

Link to comment
Share on other sites

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]

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