P. 1
Manual Harbour

Manual Harbour

|Views: 60|Likes:
Published by Romulo Artunduaga

More info:

Published by: Romulo Artunduaga on Apr 25, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

09/25/2015

pdf

text

original

__objModMethod()

__objDelData()

Delete a DATA (instance variable) from class

Syntax

__objDelMethod( , ) --> oObject

Arguments

is the object to work on.

is the symbol name of DATA to be deleted (removed) from the
object.

Returns

__objDelData() return a reference to .

Description

__objDelData() is a low level class support function that delete (remove) a
DATA from an object. is unchanged if a symbol with the name
does not exist in .

Examples

// create a new THappy class and add a lHappy DATA
oHappy := HBClass():New( "THappy" )
__objAddData( oHappy, "lHappy" )
? __objHasData( oHappy, "lHappy" ) // .T.
// remove lHappy DATA
__objDelData( oHappy, "lHappy" )
? __objHasData( oHappy, "lHappy" ) // .F.

Status

Ready

Compliance

__objDelData() is a Harbour extension.

Files

Library is rtl

See Also:

__objAddData()

__objGetMsgList()

__objGetValueList()

__objHasData()

__ObjSetValueList()

__objDerivedFrom()

Determine whether a class is derived from another class

Syntax

__objDerivedFrom( , ) --> lIsParent

Arguments

is the object to check.

is the object that may be a parent. can be either an Object or a
Character string with the class name.

Returns

__objDerivedFrom() return a logical TRUE (.T.) if is derived from
.

Description

__objDerivedFrom() is a low level class support function that check is one
class is a super class of the other, or in other words, does class a
child or descendant of .

Examples

// Create three classes and check their relations

#include "hbclass.ch"
FUNCTION main()
local oSuper, oObject, oDress
oSuper := TMood():New()
oObject := THappy():New()
oDress := TShirt():New()
? __objDerivedFrom( oObject, oSuper ) // .T.
? __objDerivedFrom( oSuper, oObject ) // .F.
? __objDerivedFrom( oObject, oDress ) // .F.

RETURN NIL

CLASS TMood
METHOD New() INLINE Self

ENDCLASS

CLASS THappy FROM TMood
METHOD Smile() INLINE qout( "*smile*" )

ENDCLASS

CLASS TShirt
DATA Color
DATA Size
METHOD New() INLINE Self

ENDCLASS

Status

Ready

Compliance

__objDerivedFrom() is a Harbour extension.

Files

Library is rtl

See Also:

__objHasData()

__objHasMethod()

RDDLIST()

Return an array of the available Replaceable Database Drivers

Syntax

RDDLIST([]) --> aRDDList

Arguments

is an integer that represents the type of the RDD you wish to
list. The constants RDT_FULL and RDT_TRANSFER represent the two types of RDDs
currently available.

ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Constant
Value Meaning
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ RDT_FULL
1 Full RDD implementation RDT_TRANSFER 2 Import/Export only
driver ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

RDT_FULL identifies full-featured RDDs that have all the capabilities
associated with an RDD.

RDT_TRANSFER identifies RDDs of limited capability. They can only transfer
records between files. You cannot use these limited RDD drivers to open a file in
a work area. The SDF and DELIM drivers are examples of this type of RDD. They are
only used in the implementation of APPEND FROM and COPY TO with SDF or DELIMITED
files.

Returns

RDDLIST() returns a one-dimensional array of the RDD names registered with
the application as .

Description

RDDLIST() is an RDD function that returns a one-dimensional array that lists
the available RDDs.

If you do not supply , all available RDDs, regardless of type, are
returned.

Examples

In this example RDDLIST() returns an array containing the
character strings, "DBF", "SDF", "DELIM", "DBFCDX", and "DBFNTX":

REQUEST DBFCDX

.
. < statements >
.

aRDDs := RDDLIST()

// Returns {"DBF", SDF", "DELIM", "DBFCDX", "DBFNTX" }

In this example, RDDLIST() returns an array containing the
character strings, "SDF" and "DELIM":

#include "rddsys.ch"
.
. < statements >
.
aImpExp := RDDLIST( RDT TRANSFER )

Tests

Status

Ready

RDDNAME()

Return the name of the currently active RDD

Syntax

RDDNAME() --> cRDDName

Arguments

Returns

current or specified work area.

Description

RDDNAME() is an RDD function that returns a character string, cRDDName, the
name of the active RDD in the current or specified work area.

You can specify a work area other than the currently active work area by
aliasing the function.

Examples

USE Customer VIA "DBFNTX" NEW
USE Sales VIA "DBFCDX" NEW

? RDDNAME() // Returns: DBFCDX
? Customer->( RDDNAME() ) // Returns: DBFNTX
? Sales->( RDDNAME() ) // Returns: DBFCDX

Tests

Status

Ready

See Also:

RDDLIST()

RDDSETDEFAULT()

Set or return the default RDD for the application

Syntax

RDDSETDEFAULT([])
--> cPreviousDefaultRDD

is a character string, the name of the RDD that is to be
made the new default RDD in the application.

Returns

RDDSETDEFAULT() returns a character string, cPreviousDefaultRDD, the name of
the previous default driver. The default driver is the driver that HARBOUR uses
if you do not explicitly specify an RDD with the VIA clause of the USE command.

Description

RDDSETDEFAULT() is an RDD function that sets or returns the name of the
previous default RDD driver and, optionally, sets the current driver to the new
RDD driver specified by cNewDefaultRDD. If is not specified,
the current default driver name is returned and continues to be the current default
driver.

This function replaces the DBSETDRIVER() function.

Examples

// If the default driver is not DBFNTX, make it the default

IF ( RDDSETDEFAULT() != "DBFNTX" )
cOldRdd := RDDSETDEFAULT( "DBFNTX" )

ENDIF

Tests

Status

Ready

See Also:

DBSETDRIVER()

__RDDSETDEFAULT()

Set or return the default RDD for the application

Syntax

__RDDSETDEFAULT([])
--> cPreviousDefaultRDD

is a character string, the name of the RDD that is to be
made the new default RDD in the application.

Returns

__RDDSETDEFAULT() returns a character string, cPreviousDefaultRDD, the name
of the previous default driver. The default driver is the driver that HARBOUR
uses if you do not explicitly specify an RDD with the VIA clause of the USE
command.

Description

RDDSETDEFAULT() is an RDD function that sets or returns the name of the
previous default RDD driver and, optionally, sets the current driver to the new
RDD driver specified by cNewDefaultRDD. If is not specified,
the current default driver name is returned and continues to be the current default
driver.

This function replaces the DBSETDRIVER() function.

Examples

// If the default driver is not DBFNTX, make it the default

IF ( __RDDSETDEFAULT() != "DBFNTX" )
cOldRdd := __RDDSETDEFAULT( "DBFNTX" )

ENDIF

Tests

Status

Ready

See Also:

DBSETDRIVER()

DBEVAL()

Performs a code block operation on the current Database

Syntax

DBEVAL( ,
[], [],
[], [],
[] ) --> NIL

Arguments

Operation that is to be performed

Code block for the For condition

Code block for the WHILE condition

Number of NEXT records to process

Record number to work on exactly

Toggle to rewind record pointer

Returns

DBEVAL() always returns NIL

Description

Performs a code block operation on the current Database

Examples

FUNCTION Main()
LOCAL nCount

USE Test

dbGoto( 4 )
? RecNo()
COUNT TO nCount
? RecNo(), nCount
COUNT TO nCount NEXT 10
? RecNo(), nCount

RETURN NIL

Status

Started

Compliance

DBEVAL is fully CA-Clipper compliant.

Files

Library is rdd

See Also:

EVAL()

DBF()

Alias name of a work area

Syntax

Dbf() -->

Returns

Name of alias

Description

This function returns the same alias name ofthe currently selected work area.

Examples

FUNCTION Main()

USE Test

select 0
qOut( IF(DBF()=="","No Name",DBF()))
Test->(qOut(DBF())
qOut(Alias(1))

RETURN NIL

Status

Ready

Compliance

DBF() is fully CA-Clipper compliant.

Files

Library is rdd

See Also:

ALIAS()

DBAPPEND()

Appends a new record to a database file.

Syntax

DbAppend(]) --> NIL

Arguments

Toggle to release record locks

Returns

DbAppend() always returns NIL

Description

This function add a new record to the end of the database in the selected or
aliased work area. All fields in that database will be given empty data values -
character fields will be filled with blank spaces,date fields with CTOD('//'),
numeric fields with 0,logical fields with .F., and memo fields with NULL bytes.The
header of the database is not updated until the record is flushed from the buffer
and the contents are written to the disk.

Under a networking enviroment, DBAPPEND() performs an additional operation: It
attrmps to lock the newly added record. If the database file is currently locked
or if a locking assignment if made to LASTREC()+1,NETERR() will return a logical
true (.T.) immediately after the DBAPPEND() function. This function does not
unlock the locked records.

If is passed a logical true (.T.) value, it will release the record
locks, which allows the application to main- tain multiple record locks during an
appending operation. The default for this parameter is a logical false (.F.).

Examples

FUNCTION Main()

USE Test
local cName="HARBOUR",nId=10
Test->(DbAppend())
Replace Test->Name wit cName,Id with nId
Use
RETURN NIL

Status

Ready

Compliance

DBAPPEND() is fully CA-Clipper compliant.

Files

Library is rdd

See Also:

DBUNLOCK()

DBUNLOCKALL()

DBCLEARFILTER()

Clears the current filter condiction in a work area

Syntax

DbClearFilTer() -> NIL

Returns

DbClearFilTer() always returns NIL

Description

This function clears any active filter condiction for the current or selected
work area.

Examples

Function Main()

Use Test

Set Filter to Left(Test->Name,2) == "An"

Dbedit()

Test->(DbClearFilter())

USE

Return Nil

Status

Ready

Compliance

DBCLEARFILTER() is fully CA-Clipper compliant.

Files

Library is rdd

See Also:

DBSETFILTER()

DBFILTER()

DBCLOSEALL()

Close all open files in all work areas.

Syntax

DbCloseAll() -> NIL

Returns

DBCLOSEALL() always return NIL

Description

This function close all open databases and all associated indexes.In
addition, it closes all format files and moves the work area pointer to the first
position

Examples

Function Main()

Use Test New

DbEdit()

Use Test1 New

DbEdit()

DbCloseAll()

USE

Return Nil

Status

Ready

Compliance

DBCLOSEALL() is fully CA-Clipper compliant.

Files

Library is rdd

See Also:

DBUSEAREA()

DBCLOSEAREA()

DBCLOSEAREA()

Close a database file in a work area.

Syntax

DbCloseArea() -> NIL

Returns

DbCloseArea() always returns NIL.

Description

This function will close any database open in the selected or aliased work
area.

Examples

Function Main()

Use Test

Dbedit()

Test->(DbCloseArea())

USE

Return Nil

Status

Ready

Compliance

DBCLOSEAREA() is fully CA-Clipper compliant.

Files

Library is rdd

See Also:

DBUSEAREA()

DBCLOSEALL()

DBCOMMIT()

Updates all index and database buffers for a given workarea

Syntax

DBCOMMIT() --> NIL

Returns

DBCOMMIT() always returns NIL.

Description

This function updates all of the information for a give,selected, or active
workarea.This operation includes all database and index buffers for that work area
only. This function does not update all open work areas.

Examples

FUNCTION Main()
LOCAL cName:=SPACE(40)
LOCAL nId:=0
USE Test EXCLUSIVE NEW
//
@ 10, 10 GET cName
@ 11, 10 GET nId
READ
//
IF UPDATED()
APPEND BLANK
REPLACE Tests->Name WITH cName
REPLACE Tests->Id WITH nId
Tests->( DBCOMMIT() )

ENDIF
RETURN NIL

Status

Ready

Compliance

This function is CA-Clipper compliant

Files

Library is rdd

See Also:

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->