C5_BOF

 BOF()
 Determine when beginning of file is encountered
------------------------------------------------------------------------------
 Syntax

     BOF() --> lBoundary

 Returns

     BOF() returns true (.T.) after an attempt to SKIP backward beyond the
     first logical record in a database file; otherwise, it returns false
     (.F.).  If there is no database file open in the current work area,
     BOF() returns false (.F.).  If the current database file contains no
     records, BOF() returns true (.T.).

 Description

     BOF() is a database function used to test for a boundary condition when
     you are moving the record pointer backward through a database file using
     the SKIP command.  A simple usage example is a descending order record
     list with an ascending order index file.  A more sophisticated example
     is a screen paging routine that pages forward or backward through the
     current database file based on the key the user presses.  When the user
     attempts to page backward, you would use BOF() to test for a beginning
     of file condition before using the SKIP command to move the record
     pointer and repaint the screen.

     Once BOF() is set to true (.T.), it retains its value until there is
     another attempt to move the record pointer.

     By default, BOF() operates on the currently selected work area.  It can
     be made to operate on an unselected work area by specifying it within an
     aliased expression (see example below).

     The SKIP command is the only record movement command that can set BOF()
     to true (.T.).

 Examples

     .  This example demonstrates BOF() by attempting to move the
        record pointer before the first record:

        USE Sales NEW
        ? RECNO(), BOF()               // Result: 1 .F.
        SKIP -1
        ? RECNO(), BOF()               // Result: 1 .T.

     .  This example uses aliased expressions to query the value of
        BOF() in unselected work areas:

        USE Sales NEW
        USE Customer NEW
        USE Invoices NEW

        ? Sales->(BOF()), Customer->(BOF())

 Files   Library is CLIPPER.LIB.

See Also: EOF() SKIP

 

OrdWildSeek()

OrdWildSeek()

Searches a value in the controlling index using wild card characters.
Syntax : OrdWildSeek( <cWildCardString>,; 
                      [<lCurrentRec>] , ;
                      [<lBackwards>] ) --> lFound

Arguments :

<cWildCardString> :

This is a character string to search in the controlling index. It may include 
the wild card characters "?" and "*". The question mark matches a single 
character, while the asterisk matches one or more characters.

<lCurrentRec> :

This parameter defaults to .F. (false) causing OrdWildSeek() to begin the 
search with the first record included in the controlling index. When .T. 
(true) is passed, the function begins the search with the current record.

<lBackwards> :

If .T. (true) is passed, OrdWildSeek() searches <cWildCardString> towards 
the begin of file. The default value is .F. (false), i.e. the function 
searches towards the end of file. 

Return :

The function returns .T. (true) if a record matching <cWildCardString> is 
found in the controlling index, otherwise .F. (false) is returned.

Description :

OrdWildSeek() searches a character string that may include wild card 
characters in the controlling index. This allows for collecting subsets 
of records based on an approximate search string. Records matching the 
search string are found in the controlling index, and the record pointer 
is positioned on the found record.

When a matching record is found, the function Found() returns .T. (true) 
until the record pointer is moved again. In addition, both functions, 
BoF() and EoF() return .F. (false).

If the searched value is not found, OrdWildSeek() positions the record 
pointer on the "ghost record" (Lastrec()+1), and the function Found() 
returns .F. (false), while Eof() returns .T. (true). The SET SOFTSEEK 
setting is ignored by OrdWildSeek().

Info :

See also: DbSeek(), LOCATE, OrdFindRec(), OrdKeyGoto(), WildMatch()

Category: Database functions, Index functions, extensions

Example :

// The example uses two wildcard search strings to show
// possible search results of OrdWildSeek()

PROCEDURE Main
   LOCAL aCust := {}

   USE Customer
   INDEX ON Upper(LastName) TO Cust01

   DO WHILE OrdWildSeek( "*MAN?", .T. )
     AAdd( aCust, FIELD->Lastname )
   ENDDO

   AEval( aCust, {|c| QOut(c) } )
   // Found records:
   // Dormann
   // Feldman

   GO TOP
   aCust := {}
   DO WHILE OrdWildSeek( "*EL*", .T. )
      AAdd( aCust, FIELD->Lastname )
   ENDDO

   AEval( aCust, {|c| QOut(c) } )
   // Found records:
   // Feldman
   // Hellstrom
   // Keller
   // Reichel
   USE
RETURN

Note : Harbour has this function without documentation. This page borrowed 
from xHarbour and not tested. Please beware about Unicode.

Strong Relation

Build strong relationships

Basics of building databases, indexs and relations.

C5 Database Functions

AFIELDS() :

Fill arrays with the structure of the current database file

AFIELDS([<aFieldNames>],
    [<aTypes>],
    [<aWidths>],
    [<aDecimals>]) --> nFields

ALIAS() : 

Return a specified work area alias

ALIAS([<nWorkArea>]) --> cAlias

BOF() : 

Determine when beginning of file is encountered

BOF() --> lBoundary

DBAPPEND() : 

Add a new record

DBAPPEND() --> NIL

DBCLEARFILTER() : 

Clear a filter condition

    DBCLEARFILTER() –> NIL

DBCLEARIND() :  Close all indexes for the current work area

    DBCLEARINDEX() --> NIL

DBCLEARREL() : 

Clear active relations

DBCLEARRELATION() --> NIL

DBCLOSEALL() : 

Close all occupied workareas

DBCLOSEALL() --> NIL

DBCLOSEAREA() : 

Close a workarea

DBCLOSEAREA() --> NIL

DBCOMMIT() : 

Flush pending updates

DBCOMMIT() --> NIL

DBCOMMITALL() : 

Flush pending updates in all workareas

DBCOMMITALL() --> NIL

DBCREATE() : 

Create a database file from a database structure array

DBCREATE(<cDatabase>, <aStruct> [, <cDriver> ] ) --> NIL

DBCREATEIND() : 

Create an Index

   DBCREATEINDEX(<cIndexName>, <cKeyExpr>,
        [<bKeyExpr>], [<lUnique>]) --> NIL

DBDELETE() : 

Mark a record for deletion

DBDELETE() --> NIL

DBEDIT() : 

        Browse records in a table layout

    DBEDIT([<nTop>], [<nLeft>],
        [<nBottom>], <nRight>],
        [<acColumns>],
        [<cUserFunction>],
        [<acColumnSayPictures> | <cColumnSayPicture>],
        [<acColumnHeaders> | <cColumnHeader>],
        [<acHeadingSeparators> | <cHeadingSeparator>],
        [<acColumnSeparators> | <cColumnSeparator>],
        [<acFootingSeparators> | <cFootingSeparator>],
        [<acColumnFootings> | <cColumnFooting>]) --> NIL

DBEVAL() : 

Evaluate a code block for each record

DBEVAL(<bBlock>,
    [<bForCondition>],
    [<bWhileCondition>],
    [<nNextRecords>],
    [<nRecord>],
    [<lRest>]) --> NIL

DBF()* : 

Return current alias name

DBF() --> cAlias

DBFIELDINFO() : 

Return and optionally change information about a field

   DBFIELDINFO(<nInfoType>,

        <nFieldPos>,
        [<expNewSetting>]) --> uCurrentSetting

DBFILEGET() : 

Insert the contents of a field into a file

     DBFILEGET(<nFieldPos>, <cTargetFile>, <nMode>)
        --> lSuccess

DBFILEPUT() : 

Insert the contents of a file into a field

     DBFILEPUT(<nFieldPos>, <cSourceFile>)
        --> lSuccess

 DBFILTER() : 

Return the current filter expression as a character string

DBFILTER() --> cFilter

DBGOBOTTOM() : 

Move to the last logical record

DBGOBOTTOM() --> NIL

DBGOTO() : 

Move to a particular record

DBGOTO(<nRecordNumber>) --> NIL

DBGOTOP() : 

Move to the first logical record

DBGOTOP() --> NIL

DBINFO() : 

         Return and optionally change database file information

    DBINFO(<nInfoType>, [<expNewSetting>])
        --> uCurrentSetting

DBORDERINFO() :          Return and optionally change information about orders and index files

    DBORDERINFO(<nInfoType>,   [<cIndexFile>],
        [<cOrder> | <nPosition>],
        [<expNewSetting>]) --> uCurrentSetting

DBRECALL() : 

Reinstate a record marked for deletion

DBRECALL() --> NIL

DBRECORDINFO() :

         Return and optionally change information about a record

    DBRECORDINFO(<nInfoType>,
        [<nRecord>],
        [<expNewSetting>]) --> uCurrentSetting

DBREINDEX() :

         Recreate all active indexes for the current work area

    DBREINDEX() --> NIL

DBRELATION() :

Return the linking expression of a specified relation

DBRELATION( <nRelation> ) --> cLinkExp

DBRLOCK() :      

         Lock the record at the current or specified identity

    DBRLOCK([<xIdentity>]) --> lSuccess

DBRLOCKLIST()          Return an array of the current lock list

   DBRLOCKLIST() --> aRecordLocks

DBRSELECT() :

Return the target workarea number of a relation

DBRSELECT( <nRelation> ) --> nWorkArea

DBRUNLOCK()    

          Release all or specified record locks

    DBRUNLOCK([<xIdentity>]) --> NIL

DBSEEK() : 

Search for a key value

DBSEEK(<expKey>, [<lSoftSeek>]) --> lFound

DBSELECTAR() : 

Change the current workarea

DBSELECTAREA(<nArea> | <cAlias>) --> NIL

DBSETDRIVER() : 

Set the default database driver

DBSETDRIVER([<cDriver>]) --> cCurrentDriver

DBSETFILTER() : 

Set a filter condition

DBSETFILTER(<bCondition>, [<cCondition>]) --> NIL

DBSETINDEX()    

         Empty orders from an order bag into the order list

    DBSETINDEX(<cOrderBagName>) --> NIL

DBSETORDER()

Set the controlling order

    DBSETORDER(<nOrderNum>) --> NIL

DBSETRELAT() :

Relate two workareas

DBSETRELATION( <nArea> | <cAlias>, <bExpr>, [<cExpr>]) --> NIL

DBSKIP() : 

Move relative to the current record

DBSKIP([<nRecords>]) --> NIL

DBSTRUCT() : 

Create an array containing the structure of a database file

DBSTRUCT() --> aStruct

DBUNLOCK()

Release all locks for the current work area

    DBUNLOCK() --> NIL

DBUNLOCKALL()

Release all locks for all work areas

    DBUNLOCKALL() --> NIL

DBUSEAREA() : 

Use a database file in a workarea

DBUSEAREA( [<lNewArea>],
    [<cDriver>],
    <cName>,
    [<xcAlias>],
    [<lShared>],
    [<lReadonly>]) --> NIL

DELETED() : 

Return the deleted status of the current record

DELETED() --> lDeleted

EOF() : 

Determine when end of file is encountered

EOF() --> lBoundary

FCOUNT() : 

Return the number of fields in the current (.dbf) file

FCOUNT() --> nFields

FIELD() : 

Return a field name from the current (.dbf) file

    FIELD/FIELD(<nPosition>) --> cFieldName

FIELDBLOCK() :

Return a set-get code block for a field variable

FIELDBLOCK(<cFieldName>) --> bFieldBlock

FIELDGET() : 

Retrieve the value of a field using the ordinal position of the field in the database structure

FIELDGET(<nField>) --> ValueField

FIELDNAME() : 

Return a field name from the current (.dbf) file

FIELDNAME/FIELD(<nPosition>) --> cFieldName

FIELDPOS() : 

Return the position of a field in a workarea

FIELDPOS(<cFieldName>) --> nFieldPos

FIELDPUT() : 

Set the value of a field variable using the ordinal position of the field in the database structure

FIELDPUT(<nField>, <expAssign>) --> ValueAssigned

FIELDWBLOCK() : 

Return a set-get block for a field in a given workarea

FIELDWBLOCK(<cFieldName>, <nWorkArea>) --> bFieldWBlock

FLOCK() : 

Lock an open and shared database file

    FLOCK() –> lSuccess

FOUND() : 

Determine if the previous search operation succeeded

FOUND() --> lSuccess

HEADER() : 

Return the current database file header length

HEADER() --> nBytes

LASTREC() : 

Determine the number of records in the current (.dbf) file

LASTREC() | RECCOUNT()* --> nRecords

LUPDATE() : 

Return the last modification date of a (.dbf) file

LUPDATE() --> dModification

RECCOUNT()* : 

Determine the number of records in the current (.dbf) file

RECCOUNT()* | LASTREC() --> nRecords

RECNO() : 

Return the current record number of a work area

RECNO() --> nRecord

RECSIZE() : 

Determine the record length of a database (.dbf) file

RECSIZE() --> nBytes

RLOCK()

Lock the current record in the active work area

    RLOCK() --> lSuccess

SELECT() : 

Determine the work area number of a specified alias

SELECT([<cAlias>]) --> nWorkArea

USED() : 

Determine if a database file is in USE

USED() --> lDbfOpen

Hex View

Hexadecimal file viewer.

This is a experimental project with first intend of point out the power of Harbour and HMG. So, HexView is considerably slow on large files, please be patient.

Download here ( source only ).