APP012.TXT TestPoint Application Note APP012.TST Associated Source File (c) Capital Equipment Corporation 1995 ________________________________________________________________ Printing Files General technique for printing text files ________________________________________________________________ TestPoint has the ability to open, close, read, write and erase files. But how do you print files? Providing a general solution for printing any Windows file isnāt easy since there are dozens of popular file types and they can store data as text or graphics in standard or compressed mode, in ASCII, vector or raster formats. There are virtually unlimited combinations. However, most applications creat ASCII files and there is a good general technique for printing these files using TestPointās File, Math and Code objects. As with most applications, we have several options. In this application weāve chosen to use the Windows file dialog provided by TestPoint's File object and weāre using the Windows Print Manager and Notepad programs to provide print spooling and other features. Start by selecting Pushbutton, Math, Code and File objects. Drag the file object to the Pushbutton Action List and choose Get filename. Set the Math objects formula = "notepad /p" & filename. This allows us to use a variable filename and the print features of the Windows Notepad program. Drag the Math object to the Action List and select Calculate. Drag the File object to the Math object's parameter field. Double click on the code object and enter the settings exactly as shown below: DLL Filename = KERNEL Subroutine Name = WinExec Argument Types = string, integer Return Type = integer Preload = 1 Drag the Code object to the Action List and youāre ready to print. If the file name is a constant, you can eliminate Action Line 1 and enter the filename as a constant. You could also provide an entry field for typed entries by using a data entry object for the filename. Another solution is to create files with .TXT extensions. Select the file using Windows file manager and simply drag and drop it on the Print Manager for automatic printing.