Jump to content

Recommended Posts

Can AutoIt v3 read lines from a text file and input that information into a GUI screen?

Lookup FileReadLine in the help file and look at the example.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to post
Share on other sites

this is one way... BigDod gave you another...

There are many ways

#include <GuiConstants.au3>
#include <file.au3>
Dim $aRecords
Dim $aFile = "error.log"; PLACE YOUR FILE NAME HERE
GuiCreate("MY GUI")
$input = GUICtrlCreateEdit("" , 20, 20, 350, 300)

If Not _FileReadToArray($aFile,$aRecords) Then
   MsgBox(4096,"Error", " Error reading log to Array     error:" & @error)
For $x = 1 to $aRecords[0]
    GUICtrlSetData( $input, $aRecords[$x] & @CRLF, 1)

$Check= GUICtrlCreateButton("Exit", 150,350,100,30)
GUISetState(); display the GUI

While 1
    $msg = GUIGetMsg()
        Case $msg= $Check
        Case $msg= $GUI_EVENT_CLOSE



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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...