PBear Posted November 30, 2004 Posted November 30, 2004 I searched through the forums last night and found two messages asking the same basic question, but neither had any replies [tsk tsk ].How do you read the contents of a file into a SplashText box? I've tried for hours, with embedding FileReadLine and SplashTextOn/ControlSetText in all different combinations of For ... Next and While ... Wend, but the best restult I can get is to display each line, as it's read in from the file, at the top of the SplashText box - where it always replaces the previous line.I tried using _FileReadToArray also, but all that got me was zeros displayed!I want to read in a simple, short file and have each new line display below the one before it, i.e., just read the whole file into the box as a text block.If anyone could help, I'd be grateful.Thanks.
killaz219 Posted November 30, 2004 Posted November 30, 2004 Is this what you want? $file = "file.txt" $chars = FileRead($file, FileGetSize($file)) SplashTextOn ("whateveryouwant", $chars) While 1 sleep(1) ;just so the splash stays up WEnd
normeus Posted December 1, 2004 Posted December 1, 2004 this is Larry's code and it will scroll text on a box#40891now add it to killaz219 code (text in a box) and you'll have a nice file scrolling box. http://www.autoitscript.com/autoit3/scite/...iTe4AutoIt3.exe
PBear Posted December 1, 2004 Author Posted December 1, 2004 (edited) Is this what you want?That's exactly what I want. (I'm embarassed how simple it was - I just didn't pick up on how to use of the FileGetSize() function to circumvent FileRead() needing to read each character in at a time, thinking FileReadLine() was the biggest chunk I could get.)Thanks a bunch.[Normeus: Thank you, too, for your add'l help. I don't want scrolling text for this particular project, but I will download the code and keep it around for future use.] Edited December 1, 2004 by PBear
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