Sign in to follow this  
Followers 0
YonZ

MsgBox, Display text from textfile in MsgBox

5 posts in this topic

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)

Share this post


Link to post
Share on other sites



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)

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.

 

Share this post


Link to post
Share on other sites

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..

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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
Sign in to follow this  
Followers 0