WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Display

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

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:
  1.   Run("notepad.exe","Selected file name") 
    

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

  3. 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:   W13215
Filename:   Display Text Greater than 255 Chars.txt
File Created: 1999:04:15:16:52:32
Last Updated: 1999:04:15:16:52:32