iceberg Posted November 22, 2005 Share Posted November 22, 2005 Hi,I need your kind assistance to do the following:I have created a text file. And I wanna display A msgbox displaying all that is in the text file.MsgBox(0, "Files Backed Up", $file1)The code doesn't work though. I have searched the forum but not quite getting there.Thanks. mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
themax90 Posted November 22, 2005 Share Posted November 22, 2005 (edited) #include <File.au3> Dim $File = "Text.txt", $Track = 1, $Information = "" $Lines = _FileCountLines($File) For $Track = 1 to $Lines Step 1 $Information = $Information & " " & FileReadLine($File, $Track) Next MsgBox(0, $File & " Information", $Information) Edited November 22, 2005 by AutoIt Smith Link to comment Share on other sites More sharing options...
LxP Posted November 22, 2005 Share Posted November 22, 2005 (edited) And even simpler (assuming that $File1 contains the path to the file):$File1 = 'C:\FilesBackedUp.txt' MsgBox(0, 'Files Backed Up', FileRead($File1, FileGetSize($File1))) Edited November 22, 2005 by LxP Link to comment Share on other sites More sharing options...
Valuater Posted November 22, 2005 Share Posted November 22, 2005 maybe like this #include <String.au3> dim $Clist $C_Text_location = @ScriptDir & '\10-20-2005.txt'; place your file location here c_display($C_Text_location) MsgBox(0,"C List", $Clist) Func c_display( $C_Text_location) Local $Cfile, $Cchars $Cfile = FileOpen($C_Text_location, 0) ; Check if file opened for reading OK If $Cfile = -1 Then MsgBox(0, "Error", "Unable to open C list " ) Exit EndIf ; Read in 1 line at a time until the EOF is reached While 3 $Cchars = FileReadLine($Cfile) If @error = -1 Then ExitLoop $Clist = $Clist & $Cchars & @CRLF Wend FileClose($Cfile) EndFunc 8) Link to comment Share on other sites More sharing options...
Valuater Posted November 22, 2005 Share Posted November 22, 2005 nice one LxP 8) Link to comment Share on other sites More sharing options...
iceberg Posted November 22, 2005 Author Share Posted November 22, 2005 thanks alot guys!!! all 3 methods work great! mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now