Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to use ItemList Box to Display a Text File or Contents of a Text File

Keywords: 	  itembox askfiletext file text

Question:

How might I go about using ItemList Box to display a text file?

Answer:

  1. If all you want to do is display the file, use AskFileText.

  2. Otherwise...
       fname="c:\temp\example.txt" ; your file
       fsize=FileSize(fname)
       bb=BinaryAlloc(fsize)
       BinaryRead(bb,fname)
       filetext=BinaryPeekStr(bb,0,fsize)
       BinaryFree(bb)
    
    Now use the filetext variable in your Dialog ItemBox.

Article ID:   W12839
Filename:   Displaying Contents of a File in ItemBox.txt