Cicode Programming Reference > Cicode Function Categories > Page Functions Introduction > PageRichTextFile

PageRichTextFile

This function creates a rich edit object, and loads a copy of the rich text file Filename into that object. The rich text object will be rectangular in shape, with dimensions determined by nHeight, and nWidth. If you do not specify nHeight and nWidth, AN will define the position of one corner, and (AN + 1) the position of the diagonally opposite corner. This function would often be used as a page entry function.

Syntax

PageRichTextFile(AN, Filename, nMode [, nHeight] [, nWidth] )

AN:

The animation point at which to display the rich text object.

Filename:

The name of the file to be copied and loaded into the rich text object. The filename needs to be entered in quotation marks "".

If you are loading a copy of an RTF report, the report needs to have already been run and saved to a file.

Remember that the filename for the saved report comes from the File Name field in the Devices form. The location of the saved file needs to also be included as part of the filename. For example, if the filename in the Devices form listed [Data];RepDev.rtf, then you would need to enter "[Data]\repdev.rtf" as your argument. Alternatively, you can manually enter the path, for example, "c:\MyApplication\data\repdev.rtf".

If you are keeping a number of history files for the report, instead of using the rtf extension, you need to change it to reflect the number of the desired history file, for example, 001.

nMode:

The display mode for the rich text object. The mode can be any combination of:

0 - Disabled - should be used if the rich text object is to be used for display purposes only.

1 - Enabled - allows you to select and copy the contents of the RTF object (for instance an RTF report), but you will not be able to make changes.

2 - Read/Write - allows you to edit the contents of the RTF object. Remember, however, that the object needs to be enabled before it can be edited. If it has already been enabled, you can just enter Mode 2 as your argument. If it is not already enabled, you will need to enable it. By combining Mode 1 and Mode 2 in your argument (3), you can enable the object, and make it read/write at the same time.

Because the content of the rich text object is just a copy of the original file, changes will not affect the actual file, until saved using the DspRichTextSave function.

nHeight:

The height of the rich text object in pixels. The height is established by measuring down from the animation point.

If you do not enter a height and width, the size of the object will be determined by the position of AN and AN+1.

nWidth:

The width of the rich text object in pixels. The width is established by measuring across to the right of the animation point.

If you do not enter a height and width, the size of the object will be determined by the position of AN and AN+1.

Return Value

None

Related Functions

DspRichText, DspRichTextLoad, DspRichTextEdit, DspRichTextEnable, DspRichTextGetInfo, DspRichTextPgScroll, DspRichTextPrint, DspRichTextSave, DspRichTextScroll, FileRichTextPrint

Example

PageRichTextFile(108,"f:\citect\data\richtext.rtf",0);
// This function would produce a rich text object at animation
point 108. Into this object a copy of f:\citect\data\richtext.rtf
would then be loaded. Remember, richtext.rtf is the name of the
output file for the report, as specified in the Devices form.
Because 0 was specified as the nMode for this example, the
contents of this object will be display only. //
PageRichTextFile(53,"[Data]\richtext.rtf",1);
//This function would produce a rich text object at animation
point 53. Into this object a copy of [Data]\richtext.rtf would
then be loaded. It will be possible to select and copy the
contents of the object, but not make changes. //

See Also

Page Functions