iceberg Posted November 22, 2005 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.
themax90 Posted November 22, 2005 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
LxP Posted November 22, 2005 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
Valuater Posted November 22, 2005 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)
iceberg Posted November 22, 2005 Author Posted November 22, 2005 thanks alot guys!!! all 3 methods work great! mouse not found....scroll any mouse to continue.
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