Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SECTION$ returns  returns a section from a document starting and ending with lines containing specific strings

Syntax

...

Arguments

  • Document$ is

     is a string containing the source document.

  • PageHeader$ is

     is a sub string of Document$ which indicates the first line of the section.

  • PageEnd$ is

     is a sub string of Document$ that indicates the end of the section.
    The result starts with the first line of Document$ containing PageHeader$ and ends with the line just before the line containing PageEnd$.

  • AddLines% is

     is an optional value, containing the number of lines to be added at the end of the section. E.g. when

    AddLines%=1

    , also the line containing PageEnd$ is included.

Remarks

  1. If PageHeader$="NullString", the function returns "NullString".
  2. If PageHeader$ is not found, the function also returns "NullString".
  3. If PageEnd$="NullString", the function returns all text from Document starting with PageHeader$.
  4. If PageEnd$ is not found, the function also returns all text from Document starting with PageHeader$.
  5. The last line of the result returned by SECTION$() is always terminated by a CrLf (Carriage Return + LineFeed: Chr$(13)+Chr$(10) ). Multiple repeating CrLf's at the end of an extracted section are removed as well as trailing strings from each line in that result.
  6. One can also use the PARAGRAPH$() function to return a section of a document.

...