Contents - Index - Previous - Next


InsertLineBreak method




Declaration
function InsertLineBreak(const ID: WideString = ''; Clear: TClear = ClearNone): Boolean;

Description

Inserts a line break (<BR> element) at the insertion point or over the selection.

Returns True on success. Returns False on failure.

The optional ID parameter specifies an ID attribute for the line break. If used, set ID to any alphanumeric string that begins with a letter. The underscore (_) can also be used. The ID should be unique throughout the scope of the current document.

The optional Clear parameter controls text flow around floating objects. The parameter specifies where the next line should appear in a visual browser after the line break caused by this element. This attribute takes into account floating objects (images, tables, etc.). Possible values are:
  • ClearNone: The next line will begin normally. This is the default value.
  • ClearLeft: The next line will begin at nearest line below any floating objects on the left-hand margin.
  • ClearRight: The next line will begin at nearest line below any floating objects on the right-hand margin.
  • ClearBoth: The next line will begin at nearest line below any floating objects on either margin.
      
    Consider the following visual scenario, where text flows to the right of an image until a line is broken by a BR:

    *********  -------
    |       |  -------
    | image |  --<BR>
    |       |
    *********

    If the clear attribute is set to none, the line following BR will begin immediately below it at the right margin of the image:

    *********  -------
    |       |  -------
    | image |  --<BR>
    |       |  ------
    *********

    If the clear attribute is set to left or all, next line will appear as follows:

    *********  -------
    |       |  -------
    | image |  --<BR clear="left">
    |       |  
    *********
    -----------------