FClose()
FCount()
FCreate()
FErase()
FError()
FieldBlock()
FieldName()
FieldPos()
FieldPut()
FieldBlock | Return a code block that sets/gets a value for a given field |
FieldWBlock | Return a sets/gets code block for field in a given work area |
HB_AParams | Returns an array containing values of all parameters passed to a function, method or procedure |
HB_ArgC | Returns the number of command line arguments |
HB_ArgCheck | Checks existence of an internal switch on the command line |
HB_ArgShift | Updates HB_Arg* parameter list removing the 1-st one and replacing it by others |
HB_ArgString | Retrieves the vale of an internal switch set on the command line. |
HB_ArgV | Retrieves the value of a command line argument |
HB_PIsByRef | Determine if a parameter is passed by reference. |
HB_PValue | Retrieves the value of an argument. |
HB_ValToStr | Converts any scalar type to a string. |
MemVarBlock | Returns a codeblock that sets/gets a value of memvar variable |
PCount | Retrieves the number of arguments passed to a function. |
Type | Retrieves the type of an expression |
ValType | Retrieves the data type of an expression |
Return a sets/gets code block for field in a given work area
Syntax
FIELDWBLOCK( <cFieldName>, <nWorkArea> ) --> bFieldBlock
Arguments
<cFieldName> is a string that contain the field name.
<nWorkArea> is the work area number in which <cFieldName> exist.
Returns
FIELDWBLOCK() return a code block that when evaluate could retrieve field value or assigning a new value for a field in a given work area. If <cFieldName> is not specified or from type other than character, or if <nWorkArea> is not specified or is not numeric FIELDWBLOCK() return NIL.
Description
FIELDWBLOCK() return a code block that sets/gets the value of field from a given work area. When this code block is evaluated without any parameters passed then it returns the current value of the given field. If the code block is evaluated with a parameter, than its value is used to set a new value to the field, this value is also return by the block. If the block is evaluate and there is no field with the name <cFieldName> in work area number <nWorkArea>, the code block return NIL.
Examples
LOCAL bField // this block work on the field "name" that exist on work area 2 bFiled := FIELDBLOCK( "name", 2 ) // open a file named One in work area 1 // that have a field named "name" SELECT 1 USE one // open a file named Two in work area 2 // it also have a field named "name" SELECT 2 USE two SELECT 1 ? "Original names: ", One->name, Two->name ? "Name value for file Two :", EVAL( bField ) EVAL( bField, "Two has new name" ) ? "and now: ", One->name, Two->name
Compliance
If the block is evaluate and there is no field with the name <cFieldName> in the given work area, the code block return NIL.
CA-Cl*pper would raise BASE/1003 error if the field does not exist.
Files
Library is rtl
Seealso
EVAL(), FIELDBLOCK(), MEMVARBLOCK()
Return a code block that sets/gets a value for a given field
Syntax
FIELDBLOCK( <cFieldName> ) --> bFieldBlock
Arguments
<cFieldName> is a string that contain the field name.
Returns
FIELDBLOCK() return a code block that when evaluate could retrieve a field value or assigning a new value to the field. If <cFieldName> is not specified or from type other than character, FIELDBLOCK() return NIL.
Description
FIELDBLOCK() return a code block that sets/gets the value of field. When this code block is evaluated without any parameters passed then it returns the current value of the given field. If the code block is evaluated with a parameter, than its value is used to set a new value to the field, this value is also return by the block. If the block is evaluate and there is no field with the name <cFieldName> in the current work area, the code block return NIL.
Note that FIELDBLOCK() works on the current work area, if you need a specific work area code block use FIELDWBLOCK() instead.
Examples
// open a file named Test that have a field named "name" LOCAL bField bFiled := FIELDBLOCK( "name" ) USE Test ? "Original value of field 'name' :", EVAL( bField ) EVAL( bField, "Mr X new name" ) ? "New value for the field 'name' :", EVAL( bField )
Compliance
If the block is evaluate and there is no field with the name <cFieldName> in the current work area, the code block return NIL.
CA-Cl*pper would raise BASE/1003 error if the field does not exist.
Files
Library is rtl
Seealso
EVAL(), FIELDWBLOCK(), MEMVARBLOCK()
WORKBLOCK() Short: ------ WORKBLOCK() Returns a set-get block for field named in an expression Returns: -------- <bBlock> => a set-get block Syntax: ------- WORKBLOCK(cExpress) Description: ------------ Determines the work area and field name in <cExpress> and returns a FIELDWBLOCK() created block for it. Examples: --------- cExpr := "CUSTOMER->LNAME" bExpr := WORKBLOCK(cExpr) ?eval(bExpr) // displays value ?eval(bExpr,"SMITH") // sets new value Source: ------- S_FIELDS.PRG
FIELDWBLOCK() Return a set-get code block for a field in a given work area ------------------------------------------------------------------------------ Syntax FIELDWBLOCK(<cFieldName>, <nWorkArea>) --> bFieldWBlock Arguments <cFieldName> is the name of the field specified as a character string. <nWorkArea> is the work area number where the field resides specified as a numeric value. Returns FIELDWBLOCK() returns a code block that, when evaluated, sets (assigns) or gets (retrieves) the value of <cFieldName> in the work area designated by <nWorkArea>. If <cFieldName> does not exist in the specified work area, FIELDWBLOCK() returns an empty block. Description FIELDWBLOCK() is a database function that builds a code block. When evaluated with the EVAL() function, the code block first selects the designated <nWorkArea>. If an argument was passed, the code block then assigns the value of the argument to <cFieldName>. If no argument was passed, the code block retrieves the value of <cFieldName>. The original work area is then reselected before the code block returns control. Note that the specified field variable may not exist when the code block is created but must exist before the code block is executed. Notes . FIELDWBLOCK() is similar to FIELDBLOCK(), except that FIELDBLOCK() incorporates a fixed work area into the set-get block. Examples . This example compares FIELDWBLOCK() to a code block created using the macro operator. Note that using FIELDWBLOCK() avoids the speed and size overhead of the macro operator: // Set-Get block for work area 1 defined with // macro operator bSetGet := &( "{ |setVal| IF( setVal == NIL, ; 1->FName, 1->FName := setVal ) }" ) // Set-Get block defined using FIELDWBLOCK() // bSetGet created here is the functional // equivalent of bSetGet above bSetGet := FIELDWBLOCK("FName", 1) Files Library is CLIPPER.LIB.
See Also: FIELDBLOCK() MEMVARBLOCK()
Fill arrays with the structure of the current database file
AFIELDS([<aFieldNames>], [<aTypes>], [<aWidths>], [<aDecimals>]) --> nFields
Return a specified work area alias
ALIAS([<nWorkArea>]) --> cAlias
Determine when beginning of file is encountered
BOF() --> lBoundary
Add a new record
DBAPPEND() --> NIL
Clear a filter condition
DBCLEARIND() : Close all indexes for the current work area
DBCLEARINDEX() --> NIL
DBCLEARREL() :
Clear active relations
DBCLEARRELATION() --> NIL
Close all occupied workareas
DBCLOSEALL() --> NIL
Close a workarea
DBCLOSEAREA() --> NIL
Flush pending updates
DBCOMMIT() --> NIL
Flush pending updates in all workareas
DBCOMMITALL() --> NIL
Create a database file from a database structure array
DBCREATE(<cDatabase>, <aStruct> [, <cDriver> ] ) --> NIL
Create an Index
DBCREATEINDEX(<cIndexName>, <cKeyExpr>, [<bKeyExpr>], [<lUnique>]) --> NIL
Mark a record for deletion
DBDELETE() --> NIL
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
Evaluate a code block for each record
DBEVAL(<bBlock>, [<bForCondition>], [<bWhileCondition>], [<nNextRecords>], [<nRecord>], [<lRest>]) --> NIL
Return current alias name
DBF() --> cAlias
Return and optionally change information about a field
<nFieldPos>, [<expNewSetting>]) --> uCurrentSetting
Insert the contents of a field into a file
DBFILEGET(<nFieldPos>, <cTargetFile>, <nMode>) --> lSuccess
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
Move to the last logical record
DBGOBOTTOM() --> NIL
Move to a particular record
DBGOTO(<nRecordNumber>) --> NIL
Move to the first logical record
DBGOTOP() --> NIL
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
Return and optionally change information about a record
DBRECORDINFO(<nInfoType>, [<nRecord>], [<expNewSetting>]) --> uCurrentSetting
Recreate all active indexes for the current work area
DBREINDEX() --> NIL
Return the linking expression of a specified relation
DBRELATION( <nRelation> ) --> cLinkExp
Lock the record at the current or specified identity
DBRLOCK([<xIdentity>]) --> lSuccess
DBRLOCKLIST() Return an array of the current lock list
DBRLOCKLIST() --> aRecordLocks
Return the target workarea number of a relation
DBRSELECT( <nRelation> ) --> nWorkArea
Release all or specified record locks
DBRUNLOCK([<xIdentity>]) --> NIL
Search for a key value
DBSEEK(<expKey>, [<lSoftSeek>]) --> lFound
Change the current workarea
DBSELECTAREA(<nArea> | <cAlias>) --> NIL
Set the default database driver
DBSETDRIVER([<cDriver>]) --> cCurrentDriver
Set a filter condition
DBSETFILTER(<bCondition>, [<cCondition>]) --> NIL
Empty orders from an order bag into the order list
DBSETINDEX(<cOrderBagName>) --> NIL
Set the controlling order
DBSETORDER(<nOrderNum>) --> NIL
Relate two workareas
DBSETRELATION( <nArea> | <cAlias>, <bExpr>, [<cExpr>]) --> NIL
Move relative to the current record
DBSKIP([<nRecords>]) --> NIL
Create an array containing the structure of a database file
DBSTRUCT() --> aStruct
Release all locks for the current work area
DBUNLOCK() --> NIL
Release all locks for all work areas
DBUNLOCKALL() --> NIL
Use a database file in a workarea
DBUSEAREA( [<lNewArea>], [<cDriver>], <cName>, [<xcAlias>], [<lShared>], [<lReadonly>]) --> NIL
Return the deleted status of the current record
DELETED() --> lDeleted
Determine when end of file is encountered
EOF() --> lBoundary
Return the number of fields in the current (.dbf) file
FCOUNT() --> nFields
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
Retrieve the value of a field using the ordinal position of the field in the database structure
FIELDGET(<nField>) --> ValueField
Return a field name from the current (.dbf) file
FIELDNAME/FIELD(<nPosition>) --> cFieldName
Return the position of a field in a workarea
FIELDPOS(<cFieldName>) --> nFieldPos
Set the value of a field variable using the ordinal position of the field in the database structure
FIELDPUT(<nField>, <expAssign>) --> ValueAssigned
Return a set-get block for a field in a given workarea
FIELDWBLOCK(<cFieldName>, <nWorkArea>) --> bFieldWBlock
Lock an open and shared database file
Determine if the previous search operation succeeded
FOUND() --> lSuccess
Return the current database file header length
HEADER() --> nBytes
Determine the number of records in the current (.dbf) file
LASTREC() | RECCOUNT()* --> nRecords
Return the last modification date of a (.dbf) file
LUPDATE() --> dModification
Determine the number of records in the current (.dbf) file
RECCOUNT()* | LASTREC() --> nRecords
Return the current record number of a work area
RECNO() --> nRecord
Determine the record length of a database (.dbf) file
RECSIZE() --> nBytes
Lock the current record in the active work area
RLOCK() --> lSuccess
Determine the work area number of a specified alias
SELECT([<cAlias>]) --> nWorkArea
Determine if a database file is in USE
USED() --> lDbfOpen