Emiel Wieldraaijer Posted February 26, 2007 Share Posted February 26, 2007 Hi All, Is there another option for this GUICtrlCreateEdit(FileRead(@TempDir & "\temp.txt") , 10 , 10, 522 , 205,BitOR($ES_READONLY, $WS_VSCROLL, $ES_MULTILINE)) Because if the text file is too big .. it cannot be displayed Thnx Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
James Posted February 26, 2007 Share Posted February 26, 2007 (edited) You need to: $edit = GUICtrlCreateEdit(FileRead(@TempDir & "\temp.txt") , 10 , 10, 522 , 205,BitOR($ES_READONLY, $WS_VSCROLL, $ES_MULTILINE)) $readme = GuiCtrlRead($edit) MsgBox(0, "", $readme) You need to make something read it.. I don't know why but thats how it works.] I read it wrong.. How long is the file? Edited February 26, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted February 26, 2007 Author Share Posted February 26, 2007 Large 1MB is nothing Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 26, 2007 Moderators Share Posted February 26, 2007 GUICtrlSetLimit($Control, FileGetSize($FileToRead)) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Teldin Posted February 26, 2007 Share Posted February 26, 2007 (edited) If the text file changes after you start your script/app, can it be reloaded within the gui without restarting the script? MsgBox(0, "", $readme) only shows what was initially read when the script was started and does not reflect any recent changes... Even when $readme = FileRead ("file.txt") Any file changes are not shown... Edited February 27, 2007 by Teldin Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted February 27, 2007 Author Share Posted February 27, 2007 @Smoke_N i don't get it .. how do you intend to implement this ? Thnx Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27, 2007 Moderators Share Posted February 27, 2007 @Smoke_Ni don't get it .. how do you intend to implement this ?Thnx EmielI don't intend to... the question is how do you intend to.Now if I did ... I would put it after my creation of the edit box... unless I was doing it in a loop and checking many files... then I would do it before my GUICtrlSetData() Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted February 27, 2007 Author Share Posted February 27, 2007 I don't intend to... the question is how do you intend to. Now if I did ... I would put it after my creation of the edit box... unless I was doing it in a loop and checking many files... then I would do it before my GUICtrlSetData() Hi SmOke_N, i'm sorry but i really don't get it $logfilegui = GuiCreate("LogFile",550,300) $edit = GUICtrlCreateEdit(FileRead(@TempDir & "\temp.txt") , 10 , 10, 522 , 205,BitOR($ES_READONLY, $WS_VSCROLL, $ES_MULTILINE)) GUICtrlSetLimit($edit, FileGetSize(@TempDir & "\temp.txt")) $LogOK = GUICtrlCreateButton ("OK",453,230,80,23,BitOr($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON)) $LogPrint = GUICtrlCreateButton ("Print",373,230,80,23) GUISetState(@SW_SHOW, $logfilegui) While 1 $msglogfile = GUIGetMsg () If $msglogfile = $GUI_EVENT_CLOSE or $msglogfile = $LogOK then ExitLoop EndIf Select case $msglogfile = $logprint PrintLogFile () Endselect Wend This still won't display a very large text file Emiel Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27, 2007 Moderators Share Posted February 27, 2007 (edited) Hi SmOke_N, i'm sorry but i really don't get it This still won't display a very large text file EmielYeah, no kidding... you are trying to put the file in the edit box before you set the limit $logfilegui = GuiCreate("LogFile",550,300) $edit = GUICtrlCreateEdit('' , 10 , 10, 522 , 205,BitOR($ES_READONLY, $WS_VSCROLL, $ES_MULTILINE)) GUICtrlSetLimit($edit, FileGetSize(@TempDir & "\temp.txt")) GUICtrlSetData($edit, FileRead(@TempDir & "\temp.txt")) $LogOK = GUICtrlCreateButton ("OK",453,230,80,23,BitOr($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON)) $LogPrint = GUICtrlCreateButton ("Print",373,230,80,23) GUISetState(@SW_SHOW, $logfilegui) While 1 $msglogfile = GUIGetMsg () If $msglogfile = $GUI_EVENT_CLOSE or $msglogfile = $LogOK then ExitLoop EndIf Select case $msglogfile = $logprint PrintLogFile () Endselect Wend Edited February 27, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Emiel Wieldraaijer Posted February 27, 2007 Author Share Posted February 27, 2007 @SmOke_N i could kiss you .. if you were a woman .. I'm learning.. Thnx Thnx Thnx Best regards,Emiel Wieldraaijer Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27, 2007 Moderators Share Posted February 27, 2007 (edited) @SmOke_N i could kiss you .. if you were a woman .. ... Yeah ... Keep your lips to yourself!! ... Have a cute sister that's not jail bait? J/K Edited February 27, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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