Jump to content

Input from text file


jotis01
 Share

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 comment
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)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    GUICtrlSetData( $input, $aRecords[$x] & @CRLF, 1)
Next

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

While 1
    $msg = GUIGetMsg()
  
    Select
        
        Case $msg= $Check
            Exit
        Case $msg= $GUI_EVENT_CLOSE
            Exit
            
    EndSelect
WEnd

8)

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...