jesternaut Posted April 8, 2008 Share Posted April 8, 2008 Hello, And thanks for having a look. I am concatenating several files into one and displaying the resulting file in a msgbox. My problem is that the file is larger that the display and it scrolls off the bottom of the screen and no way to see the bottom of the msgbox. I don't see a way to add scroll controls to the msgbox. The following is the function I am calling and the last line of the last if statement is where I am stuck. CODEFunc dsply_log() $chars = "0" $icounter = 7 ;max number of logs to read $iolder_than = $slogfilename While $iolder_than > 0 ;next two lines insures the necessary preceding zero's are in place else the systen can't see the log files If $iolder_than < 100 And $iolder_than > 9 Then $iolder_than = "0" & $iolder_than If $iolder_than < 10 And $iolder_than > 0 Then $iolder_than = "00" & $iolder_than If FileExists(@ScriptDir & "\" & $iolder_than & ".log") Then ;checks for the file first $file = FileOpen(@ScriptDir & "\" & $iolder_than & ".log", 0);reads file into var While 1 ; reads var char by char into $chars $chars &= FileRead($file) If @error = -1 Then ExitLoop; this indicated EOF is found and exits loop Wend FileClose($file) $icounter = $icounter - 1 If $icounter = 0 then ExitLoop EndIf $iolder_than = $iolder_than -1 WEnd If $chars = '' Then MsgBox(0, "Test Log", "No logs found") Else MsgBox(0, "Test Log", $chars) EndIf EndFunc Thanks again Link to comment Share on other sites More sharing options...
martin Posted April 8, 2008 Share Posted April 8, 2008 Hello,And thanks for having a look.I am concatenating several files into one and displaying the resulting file in a msgbox. My problem is that the file is larger that the display and it scrolls off the bottom of the screen and no way to see the bottom of the msgbox. I don't see a way to add scroll controls to the msgbox.The following is the function I am calling and the last line of the last if statement is where I am stuck.CODEFunc dsply_log()$chars = "0"$icounter = 7 ;max number of logs to read$iolder_than = $slogfilenameWhile $iolder_than > 0 ;next two lines insures the necessary preceding zero's are in place else the systen can't see the log files If $iolder_than < 100 And $iolder_than > 9 Then $iolder_than = "0" & $iolder_than If $iolder_than < 10 And $iolder_than > 0 Then $iolder_than = "00" & $iolder_than If FileExists(@ScriptDir & "\" & $iolder_than & ".log") Then ;checks for the file first $file = FileOpen(@ScriptDir & "\" & $iolder_than & ".log", 0);reads file into var While 1 ; reads var char by char into $chars $chars &= FileRead($file) If @error = -1 Then ExitLoop; this indicated EOF is found and exits loop Wend FileClose($file) $icounter = $icounter - 1 If $icounter = 0 then ExitLoop EndIf $iolder_than = $iolder_than -1WEnd If $chars = '' Then MsgBox(0, "Test Log", "No logs found")Else MsgBox(0, "Test Log", $chars)EndIfEndFuncThanks againInstead of the MsgBox if $chars <> '' you could make your own gui and put an edit in it. Put $chars in the edit and then the user can scroll to the bottom. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
nobbe Posted April 8, 2008 Share Posted April 8, 2008 hi a message box wont work you need a separate dialog with an editcontrol GUICtrlCreateEdit(). 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