English

How To: Display an ASCII text file in a pop-up window using Avenue

Summary

The following Avenue script displays an ASCII text file in a pop-up window.

Procedure

  1. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Paste the following code into the new script window:

    Code:
    myFile = LineFile.Make("<ascii_text_file_name".AsFilename,#FILE_PERM_READ)
    VeryLongString = myFile.ReadElt
    while (myFile.IsAtEnd.Not)
    VeryLongString = VeryLongString + NL + myFile.ReadElt
    end
    myFile.Close
    MsgBox.Report(VeryLongString,"")


    Note:
    Replace the text "<ascii_text_file_name>" with the path to the text file you would like view.

  3. Select compile from the Script menu or click the
    [O-Image] Script compile button
    button.
  4. Click the
    [O-Image] Run compiled script button
    button to run the script.