How can I make this INI appear in a list view GUI

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Aperry91
Posts: 6
Joined: 30 Jun 2017, 19:11

How can I make this INI appear in a list view GUI

18 Jul 2017, 13:52

I am fairly new to AHK and would appreciate if someone could help me create a list view from an INI file.

Code: Select all

INI =
(
[PROJECT-1]
Company=Company A
Remarks=Info about Project 1
Status=Current
Value=Some Value not needed
[PROJECT-2]
Company=Company B
Remarks=Info about Project 2
Status=Late
Values=Some Value not needed
If possible I would like to make a listview with header that looks like this...

Code: Select all

PROJECT		COMPANY		REMARKS					STATUS     
Project-1 |Company A  | Info about Project 1   | Current
Project-2 |Company B  | Info about Project 2   | Late
...while leaving out the Value fields.
I have been trying to do this with a parsing loop but having no luck. Help greatly appreciated!
Guest

Re: How can I make this INI appear in a list view GUI

18 Jul 2017, 14:03

Many ways, this is one way, only partially but just showing how to read the data (again many ways to do it)

Code: Select all

; just for test
FileDelete,test.ini
FileAppend,
(
[PROJECT-1]
Company=Company A
Remarks=Info about Project 1
Status=Current
Value=Some Value not needed
[PROJECT-2]
Company=Company B
Remarks=Info about Project 2
Status=Late
Values=Some Value not needed
)
,test.ini

;------------

; Make your GUI with Listview here (see doc example)

IniRead, OutputVarProjects, test.ini
MsgBox % OutputVarProjects

Loop, parse, OutputVarProjects, `n
	{
	LVDATA:="" 	
	IniRead, OutputVarSection, test.ini, %A_LoopField%
	MsgBox % OutputVarSection
	Loop, parse, OutputVarSection, `n
		LVDATA .= StrSplit(A_LoopField,"=").2 ","
	MsgBox % LVDATA	
	; do your LV_Add here with LVDATA variable	
	}
; Gui Show here	
	
Try something, post code if you get stuck and need more help

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 251 guests