anixon Posted November 22, 2006 Posted November 22, 2006 How do I make the the value assigned to $line using FileReadLine a 'Const' for the time that the script is running? $file = FileOpen("c:\temp\test\xyz.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line) Wend FileClose($file)
GaryFrost Posted November 22, 2006 Posted November 22, 2006 You don't $s_text = "" $file = FileOpen("c:\temp\test\xyz.txt", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $s_text &= $line & @LF WEnd FileClose($file) $s_text = StringTrimRight($s_text,1) MsgBox(0,"File Read", $s_text) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
anixon Posted November 22, 2006 Author Posted November 22, 2006 Wonderful worked a treat. Thanks very much for your help.
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