Agent29 Posted September 1, 2009 Posted September 1, 2009 Hello!Ok, I have the following programNext to the "Warning" Button, I would like to add a Drop down, This I can do. But I want it to auto populate by reading data from a INI File, and When you select one, It fills the input boxes with the Information under that section in the INI file...INI file like this[Pokename] HP= ATK= DEF= SPATK= SPDEF= SPD=Any Idea to better it are welcome Please point me in the right direction here.
6105 Posted September 1, 2009 Posted September 1, 2009 (edited) u can use like this: ;files Global Const $inifile=@ScriptDir & "\setings.ini" ;default proces $atk=10 $def=2 $hp=100 Func CreateorReadini() if not FileExists($inifile) Then $inifileopen = FileOpen($inifile, 1) If $inifileopen = -1 Then MsgBox(0, "Error", "Unable to open ini file.") Exit EndIf FileClose($inifileopen) readvaluesfromini() IniWrite($inifile,"Settings", "Attack", $atk) IniWrite($inifile,"Settings", "HP", $hp) IniWrite($inifile,"Settings", "Defence", $def) endIf EndFunc func readvaluesfromini() if FileExists($inifile) Then Global $atk = IniRead($inifile, "Settings", "Attack", 0 ) Global $hp = IniRead($inifile, "Settings", "HP", 0 ) Global $def = IniRead($inifile, "Settings", "Defence", 0) EndIf EndFunc Edited September 1, 2009 by toader [center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now