FormatLine (a virtual to format text)

Top  Previous  Next

 

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

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