User Tools

Site Tools


formatline_a_virtual_to_format_text_.htm
Navigation:  ABC Library Reference > ASCIIFileClass > AsciiFileClass Methods >====== FormatLine (a virtual to format text) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

FormatLine( line [, line number ] ), PROTECTED, VIRTUAL

blk2blue.jpg

FormatLine A virtual placeholder method to format text.
line The label of the STRING variable containing the text to reformat.
line number An integer constant, variable, EQUATE or expression that contains the offset or position of the line of text being formatted. If omitted, FormatLine operates on the current line.

The FormatLine method is a virtual placeholder method to reformat text prior to display at runtime.

Implementation:

The FormatLine method is a placeholder for derived classes. It provides an easy way for you to reformat the text prior to display. The GetLine method calls the FormatLine method.

Example:

INCLUDE('ABASCII.INC')                     !declare ASCIIViewerClass

MyViewer   CLASS(AsciiViewerClass),TYPE     !derive MyViewer class

FormatLine  PROCEDURE(*STRING),VIRTUAL      !prototype virtual FormatLine

          END

Viewer    MyViewer,THREAD                   !declare Viewer object

AsciiFile   FILE,DRIVER('ASCII'),NAME('MyText'),PRE(A1),THREAD

RECORD       RECORD,PRE()

Line          STRING(255)

            END

           END

CODE

!program code

MyViewer.FormatLine PROCEDURE(*STRING line)  !called by ASCIIViewerClass

CODE

line = line[1:5]'  '&line[5:55]             !reformat the text

See Also:

GetLine

formatline_a_virtual_to_format_text_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)