Cicode Programming Reference > Cicode Function Categories > Display Functions Introduction > DspFile

DspFile

Defines the screen attributes for displaying a text file. This function defines a "window" where the file will be displayed. You should call this function before any file-to-screen function.

you need to define sequential ANs for each line of text in the display. The file is displayed starting at the specified AN, then the next (highest) AN, and so on. You should not use proportionally-spaced fonts, because the columns of text might not be aligned.

You would normally call this function as the entry function for a graphics page. Use the DspFileSetName() function to specify the file to be displayed. This function is a low level animation function - it controls exactly how the file is to display. If you just want to display a file, use the PageFile() function.

Syntax

DspFile(AN, hFont, Height, Width)

AN:

The AN where the file display window will be positioned. When this is set to -2, the window will be created in the Citect Kernel. However, the hFont argument is ignored.

hFont:

The handle for the font that is used to display the file, returned from the DspFont() or DspFontHnd() function. The font handle identifies the table where all data on the associated font is stored.

Height:

The maximum number of lines to display on one page of the file display window.

Width:

The width of the file display window, in characters.

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

PageFile, DspFileGetInfo, DspFileGetName, DspFileScroll, DspFileSetName, DspFont, DspFontHnd

Example

DspFile(20,0,20,80);
/* Defines the attributes of a screen display to start at AN20, using the default font, with a window size of 20 lines x 80 columns. */

See Also

Display Functions