YonZ Posted September 8, 2006 Posted September 8, 2006 How can I do this? I just can't find out how... I have a textfile named $LogFile, with max 10 lines of text. and I want to display that file in a MsgBox... in ReadOnly It should be simple but I can not find out how.... so I thougt i should use FileOpen($LogFile,0) and MsgBox(0,"My logfile", ????,15)
GaryFrost Posted September 8, 2006 Posted September 8, 2006 How can I do this?I just can't find out how...I have a textfile named $LogFile, with max 10 lines of text.and I want to display that file in a MsgBox... in ReadOnlyIt should be simple but I can not find out how....so I thougt i should use FileOpen($LogFile,0) and MsgBox(0,"My logfile", ????,15)Look at FileRead in the help also SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
YonZ Posted September 8, 2006 Author Posted September 8, 2006 Look at FileRead in the help also If $LogFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $chars = FileRead($LogFile, 1) If @error = -1 Then ExitLoop MsgBox(0, "Log file:", $chars) Wend FileClose($LogFile) This does not work... I get small msgBox up, 3 or 4 times, with out any text, just the title, and then my script loops..
GaryFrost Posted September 8, 2006 Posted September 8, 2006 If $LogFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $chars = FileRead($LogFile, 1) If @error = -1 Then ExitLoop MsgBox(0, "Log file:", $chars) Wend FileClose($LogFile) oÝ÷ Ù8b±Ú²z-Âä"²f¥k n§z+âØ¦zÌ"¶.µ©òµìmë-¶Ù^jwméæÊÇ+e¢lþ«¨µæ®¶s`¢b33c·5ôÆöuFWBÒfÆU&VBb33c´ÆötfÆR instead of 1 character at a time, it will read the whole file. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
YonZ Posted September 9, 2006 Author Posted September 9, 2006 Thanx, it is working now, I thought I should do it some how like this, but I did not find out how... $s_LogText = FileRead($LogFile) MsgBox(0,"Log file ", $s_LogText, 15)
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