Jump to content
Sign in to follow this  
kjcdude

Simple InI Viewer - Array Problem

Recommended Posts

kjcdude

I'm not good at arrays, and i rarley work on gui's, so i need some help.

I need to read around 200 ini files and output all of their data to an easily viewable gui.

I'm able to create the gui, and input 1 files worth of data, but that's it.

#include <GUIConstants.au3>
#include <Array.au3>

$gui = GUICreate("ListView items", 400, 300, -1, -1, -1, $WS_EX_ACCEPTFILES)
;create gui
$listview = GUICtrlCreateListView("APP|001|002|003|004|005|006", 10, 10, 380, 280);,$LVS_SORTDESCENDING)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)   ; to allow drag and dropping
GUISetState()
;computers 1-10 (Temp#)
for $l = 01 to 10
;Log Files
$file = "\\nas01\Volume_1\Update System\Log\11-24-07 - 0" & $l & ".ini"

$ssection = IniReadSectionNames($file)
Next

For $i = 1 To $ssection[0]
    $list = IniReadSection($file, $ssection[$i])
    $tmp = ''
        ;set title by Modified info inside initial ini file
    If $ssection[$i] = 'Modified' Then
        WinSetTitle($gui, "", "ListView items - " & $list[1][1])
        ContinueLoop
    EndIf
        For $x = 1 To $list[0][0]
        $tmp = $list[$x][1] & "|"
    Next
    $tmp = StringTrimRight($tmp,1)
        GUICtrlCreateListViewItem($ssection[$i] & "|" & $tmp, $listview)
Next

GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, 100)

Do
    $msg = GUIGetMsg()

    Select
        Case $msg = $listview
            MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

Example of an ini file for pc 7

[Modified]
When=01/16/2008 - 03:13:03
[AOE3]
007=1
[BF2]
007=0
[BFMEII]
007=1
[COD4]
007=1
[COH]
007=0

Share this post


Link to post
Share on other sites
Bowmore

I'm not good at arrays, and i rarley work on gui's, so i need some help.

I need to read around 200 ini files and output all of their data to an easily viewable gui.

I'm able to create the gui, and input 1 files worth of data, but that's it.

#include <GUIConstants.au3>
#include <Array.au3>

$gui = GUICreate("ListView items", 400, 300, -1, -1, -1, $WS_EX_ACCEPTFILES)
;create gui
$listview = GUICtrlCreateListView("APP|001|002|003|004|005|006", 10, 10, 380, 280);,$LVS_SORTDESCENDING)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)   ; to allow drag and dropping
GUISetState()
;computers 1-10 (Temp#)
for $l = 01 to 10
;Log Files
$file = "\\nas01\Volume_1\Update System\Log\11-24-07 - 0" & $l & ".ini"

$ssection = IniReadSectionNames($file)
Next

For $i = 1 To $ssection[0]
    $list = IniReadSection($file, $ssection[$i])
    $tmp = ''
        ;set title by Modified info inside initial ini file
    If $ssection[$i] = 'Modified' Then
        WinSetTitle($gui, "", "ListView items - " & $list[1][1])
        ContinueLoop
    EndIf
        For $x = 1 To $list[0][0]
        $tmp = $list[$x][1] & "|"
    Next
    $tmp = StringTrimRight($tmp,1)
        GUICtrlCreateListViewItem($ssection[$i] & "|" & $tmp, $listview)
Next

GUICtrlSendMsg($ListView, $LVM_SETCOLUMNWIDTH, 0, 100)

Do
    $msg = GUIGetMsg()

    Select
        Case $msg = $listview
            MsgBox(0, "listview", "clicked=" & GUICtrlGetState($listview), 2)
    EndSelect
Until $msg = $GUI_EVENT_CLOSE

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.