How to Display Text Greater than 255 Characters
Keywords: 255 characters 256 characters 111:Execution Error Line too long(>255 characters)
Question:
WB Message boxes and BoxText functions are restricted to 255 characters. How can I display text greater than 255 characters to the user?Answer:
You can show the file in one of three ways:
Run("notepad.exe","Selected file name")
- Or maybe - for small files:
fn="c:\yourfilename" fs=FileSize(fn) bb=BinaryAlloc(fs) BinaryRead(bb,fn) DaFile=BinaryPeekStr(bb,0,fs) BinaryFree(bb) DaFile=StrReplace(DaFile,@CRLF,@TAB)Then use DaFile as your ItemListBox variable.Should work OK for files up to about 1000 bytes.
You can display a larger file size, but if you use a larger file size, for example, 20K, you won't be able to do much else in the program.
- Use AskFileText to display a file's contents to the user. This requires a response from the user however, so, if you need to, you can auto-answer the AskFileText with another WB script that you launch just before the AskFileText, that waits for that window to appear, and then closees it after a certain period of time.
Article ID: W13215Filename: Display Text Greater than 255 Chars.txt