Jump to content
Sign in to follow this  

Need help with array

Recommended Posts

I posted before about dumping event log, now my boss wants me to do something different so i have to start over. Anyway haha.....havent programed in a while let alone with autoit. How can i get this to show up in the list view

Func _GetLog()
    Dim $line
    Dim $eType
    Dim $eEvent
    Dim $Array[5]
    Dim $x
    $foo = Run(@ComSpec & " /c " & @SystemDir & "\CSCRIPT.EXE  EVENTQUERY.VBS /L System /R 20 /FO CSV //Nologo >> c:\sys.txt", @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    If Not _FileReadToArray("c:\sys.txt", $line) Then
        MsgBox(4096, "Error", " Error reading file to Array - error:" & @error)
    ;5$line = StringStripWs($line, 8)
    For $x = 1 To $line[0]
        $Array = StringSplit($line[$x], ",")
        ;$eType = $line[1]
        ;$eEvent = $line[2]
        ;$eTest = $line[$x]
        GUICtrlCreateListViewItem($Array[1] & " | " &  "" &  " | " & "" & " | " & "" & " | " & "" & " | ", $lstViewGrid)
        ;MsgBox(0,"", $eType)
        ;MsgBOx(0,"", $eEvent)
    ;If FileExists("c:\sys.txt") Then
    ;   $Open = FileOpen("c:\sys.txt",0)
    ;   $Read = FileRead($Open)
    ;   $file = StringStripWS(StringTrimLeft($Read, 220), 8)
    ;   $new = StringSplit($file, ",")
    ;   MsgBox(0,"",$new[1])
    ;   Msgbox(0,"",$new[2])

i have alot commented out for debugging crap, i know its a mess but im at a loss for the moment. Any help is appreciated


Share this post

Link to post
Share on other sites

why have the arraydisplay in there just curios and if you want to add somethign to the listview change the [1] to [$x]

did the array display so i could make sure that its grabbing at least some info and stuffin it into an array.

I did change the [1] to [$x] gave me an error about the subscript and would put the data into the list view

Share this post

Link to post
Share on other sites

not sure on the data, how about string replace and just put that in the listview?


$s_text = StringReplace($line[$x], ",","|")
        GUICtrlCreateListViewItem($s_text, $lstViewGrid)

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


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  

  • Create New...