Deutsch English
Alphabetical index
Array functions
CGI functions
Data types
Date functions
Fulltext functions
  • genlist()
  • genrel()
  • getftinfo()
  • markbits()
  • marktable()
  • scanrec()
  • scanrecs()
  • unscanrec()
    Language elements
    Numerical functions
    Other functions
    Ramtext functions
    Socket functions
    Statistical functions
    Stream functions
    String functions
    System functions
    Table functions
    Text functions
    Home    Overview    Search    Impressum    Contact    Members
    Topic complex Fulltext functions
    Function markbits()
    Short Search in the fulltext index
    Syntax MarkBits(D,I,Suchstring,ExtABC,Ops,MaskenZahl,BitFeld,R1,R2,...) : INTEGER
    Parameter D: table handle of the defined table
    I: table handle of the index table
    Searchstring : search string
    ExtABC: like at ScanRecs
    Ops: logical operators
    Mask_number: Integer
    BitField: Variable of the type TBits[xxx]
    R1, R2...: table handles of the relations tables
    Return >=0 : number of the found records
    <0 : error code
    See also:
    scanrecs() marktable() genrel() genlist()
    Description The function result is the number if the found records (if positive) resp. one of the error codes:

    -64 invalid index table
    -77 invalid relations table
    -56 illegal parenthesis in the search string
    -45 invalid char in the search string

    The last two errors can be defined closer with TDB_ErrorMsg and TDB_ErrorOfs.

    The search string is a string of the following form:

    Searchstring ::= expression
    expression ::= Term { OR operator Term}
    Term ::= Factor { AND-operator Factor}
    Factor ::= search word | "(" expression ")"

    A search word is a string with letters, the chars from ExrABC and the special chars "?" and "*". Thereby "?" means one any desired char, "*" means any number of chars.

    The following operators are predefined (if in Ops an empty string is delifered):

    OR-Operator + (set union, logical OR)
    AND-Operators , (intersection, logical AND)
    - (section with complement set, logical AND NOT)


    Meier finds all records which include the word Meier case insensitive.
    Mei*er finds all records which includes words that start with "Mei" and end with "er".
    Hans, Meier in the record as the word Hans as the Meier has to be included.
    Hans+Meier finds records that include Hans or Meier or both.
    Hans-Meier finds records that includes Hans but nor Meier.


    In the parameter Ops operators can be redefined. For it a string with exactly three chars has to be deliferd. The first char is the sign of the operator for logical AND, the second is the logical OR and at least the third is the logical AND NOT.

    Mask number

    The specification of a mask number makes only then sence if already at the fulltext indexing has been worked with a mask field or a mask constant. The here defined number and the in the link saved number are linked with a binary AND. Only those records are found where the binary AND results a value else than 0.

    Special case: The mask number 0 returns all links.


    the fulltext indexing takes place with the following index description:

    The search for Hans returns than depending on the mask number

    0 In (at least) one of the fields the word is included
    1 The word is in the field name included
    2 The word is in the fielf Firstname included
    3 The word is in the field Name or in the field Firstname (or in both) included
    4 The word is in the field Street included
    5 The word is in the field Name or in the field Street (or in both) included
    7 The word is in (at least) one of the fields Name, Firstname or Street included.


    In this parameter both search functions differ. At MarkTable the hits are entered to the marking list of the table directly. At MarkBits the hits are transmitted to a bitfield. That is an advantage if it is searched for more than one time and the single search results should be put together to one whole result.


    VAR hits, Temp : TBITS[1000000]

    BitAnd(hits,Marks) (results the intersection of both searches)
    BitOr(hits,Marks) (results the set union of both searches)

    Experts hint: A bitfield like we use it here also can be understood as characteristical set function, so a image of the set of all records of a table to the set {0,1}. That is a very efficient implementing of (sub-)sets because the set functions are executed directly (as fundamental maschine operations). Also MarkTable works internal with a bitfield and images the found set to the marking list only at the end.

    User comments:
    Write a comment:
    Text (Switch mode)

    Choose between
    the normal and the
    advanced editor.
    The advanced editor
    runs in IE 5+ and
    Mozilla 1.4+ only
    SPAM-Protection Please enter tdbengine in this field.

    tdbengine chat

       Copyright © 2003-2004 tdb Software Service GmbH
       Alle rechte vorbehalten. / All rights reserved
       Last changed: 21.10.2004
    {Fehler für :execmacro{execmacro="sessionspy"}