NIL A2EDIT(<nTop>, <nLeft>, <nBottom>, <nRight>, <aData>, <cUserFunc>, <aSay>, <aHeaders>, <aHeadSep>, <aColSep>, <aFootSep>, <aFooters>) Value AADD(<aTarget>, <expValue>[, <keyValue>]) aDuplicate ACLONE(<aSource>) aTarget ACOPY(<aSource>, <aTarget>, [<nStart>], [<nCount>], [<nTargetPos>]) aTarget ADEL(<aTarget>, <nPosition>) aArray AEVAL(<aArray>, <bBlock>, [<nStart>], [<nCount>]) aTarget AFILL(<aTarget>, <expValue>,[<nStart>], [<nCount>]) aTarget AINS(<aTarget>, <nPosition>) aArray ARRAY(<nElements> [, <nElements>...]) <nStoppedAt> ASCAN(<aArr>, <Expression>, [<nStart>], [<nCount>], [lBack]) aTarget ASIZE(<aTarget>, <nLength>) aTarget ASORT(<aTarget>, [<nStart>],[<nCount>], [<bOrder>]) Element ATAIL(<aArray>) aDirectory DIRECTORY(<cDirSpec>, [<cAttributes>]) lEmpty EMPTY(<exp>) <aSelected> __Fledit( <aSrc>, <aList>) aNewArray FT_AADDITION( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ; nAverage FT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) aSorted FT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) nMaxlen FT_AEMAXLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ; nMinlen FT_AEMINLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) nMedian FT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] ) nNoOfMatches FT_ANOMATCHES( <aArray>, <bCompareBlock> ; [, <nStartIndex> [, <nEndIndex> ] ] ) xElement FT_AREDIT( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ; <nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) nSum FT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) aArray FT_RESTARR( <cFileName>, <nErrorCode> ) lRet FT_SAVEARR( <aArray>, <cFileName>, <nErrorCode> ) nCount LEN(<cString> | <aTarget>) <oObject> MAP() <lOldMode> MAPMODIFY(<oObj>, <lMode>) cType TYPE(<cExp>) cType VALTYPE(<exp>)
A2EDIT(<nTop>, <nLeft>, <nBottom>, <nRight>, <aData>, <cUserFunc>, <aSay>, <aHeaders>, <aHeadSep>, <aColSep>, <aFootSep>, <aFooters>) --> NIL
A2EDIT() is a array function that determines the browse 2D array data in a table layout.
A2EDIT() lake a DBEDIT() function.
<nTop> | Numeric, is the upper coordinates of the A2EDIT() window. |
<nLeft> | Numeric, is the left coordinates. |
<nBottom> | Numeric, is the bottom coordinates. |
<nRight> | Numeric, is the right coordinates. |
<aData> | Array, is the 2D array to browse. |
<cUserFunc> | String, is the user function name. |
<aSay> | Array, is the picture clauses to format each column. |
<aHeaders> | Array, is the column headers. |
<aHeadSep> | Array or character, is the heading separators. |
<aColSep> | Array or character, is the columns separators. |
<aFootSep> | Array or character, is the footings separators. |
<aFooters> | Array, is the footings data. |
Returns : | A2EDIT() returns NIL. |
See also : | DBEDIT() |
AADD(<aTarget>, <expValue>[, <keyValue>]) --> Value
AADD() is an array function that increases the actual length of the target array by one. The newly created array element is assigned the value specified by <expValue>.
AADD() is used to dynamically grow an array. It is useful for building dynamic lists or queues. A good example of this is the GetList array used by the Get system to hold Get objects. After a READ or CLEAR GETS, GetList becomes an empty array. Each time you execute an @...GET command, the Get system uses AADD() to add a new element to the end of the GetList array, and then assigns a new Get object to the new element.
AADD() is similar to ASIZE() but only adds one element at a time; ASIZE() can grow or shrink an array to a specified size. AADD(), however, has the advantage that it can assign a value to the new element, while ASIZE() cannot. AADD() may also seem similar to AINS(), but they are different: AINS() moves elements within an array, but it does not change the array's length.
Note: If <expValue> is another array, the new element in the target array will contain a reference to the array specified by <expValue>.
ACLONE(<aSource>) --> aDuplicate
ACLONE() is an array function that creates a complete duplicate of the <aSource> array. If <aSource> contains subarrays, ACLONE() creates matching subarrays and fills them with copies of the values in the <aSource> subarrays. ACLONE() is similar to ACOPY(), but ACOPY() does not duplicate nested arrays.
ACOPY(<aSource>, <aTarget>, [<nStart>], [<nCount>], [<nTargetPos>]) --> aTarget
ACOPY() is an array function that copies elements from the <aSource> array to the <aTarget> array. The <aTarget> array must already exist and be large enough to hold the copied elements. If the <aSource> array has more elements, some elements will not be copied.
ACOPY() copies values of all data types including NIL and code blocks. If an element of the <aSource> array is a subarray, the corresponding element in the <aTarget> array will contain a reference to the subarray. Thus, ACOPY() will not create a complete duplicate of a multidimensional array. To do this, use the ACLONE() function.
<aSource> | is the array to copy elements from. |
<aTarget> | is the array to copy elements to. |
<nStart> | is the starting element position in the <aSource> array. If not specified, the default value is one. |
<nCount> | is the number of elements to copy from the <aSource> array beginning at the <nStart> position. If <nCount> is not specified, all elements in <aSource> beginning with the starting element are copied. |
<nTargetPos> | is the starting element position in the <aTarget> array to receive elements from <aSource>. If not specified, the default value is one. |
Returns : | ACOPY() returns a reference to the target array, <aTarget>. |
See also : | ACLONE() ADEL() AEVAL() AFILL() AINS() ASORT() |
ADEL(<aTarget>, <nPosition>) --> aTarget
ADEL() is an array function that deletes an element from an array. The contents of the specified array element is lost, and all elements from that position to the end of the array are shifted up one element. The last element in the array becomes NIL.
Warning! xClipper implements multidimensional arrays by nesting arrays within other arrays. If the <aTarget> array is a multidimensional array, ADEL() can delete an entire subarray specified by <nPosition>, causing <aTarget> to describe an array with a different structure than the original.
AEVAL(<aArray>, <bBlock>, [<nStart>], [<nCount>]) --> aArray
AEVAL() is an array function that evaluates a code block once for each element of an array, passing the element value and the element index as block parameters. The return value of the block is ignored. All elements in <aArray> are processed unless either the <nStart> or the <nCount> argument is specified.
AEVAL() makes no assumptions about the contents of the array elements it is passing to the block. It is assumed that the supplied block knows what type of data will be in each element.
AEVAL() is similar to DBEVAL() which applies a block to each record of a database file. Like DBEVAL(), AEVAL() can be used as a primitive for the construction of iteration commands for both simple and complex array structures.
Refer to the Code Blocks section in the "Basic Concepts" chapter of the Programming and Utilities Guide for more information on the theory and syntax of code blocks.
<aArray> | is the array to traverse. |
<bBlock> | is a code block to execute for each element encountered. |
<nStart> | is the starting element. If not specified, the default is element one. |
<nCount> | is the number of elements to process from <nStart>. If not specified, the default is all elements to the end of the array. |
Returns : | AEVAL() returns a reference to <aArray>. |
See also : | DBEVAL() EVAL() QOUT() |
AFILL(<aTarget>, <expValue>,[<nStart>], [<nCount>]) --> aTarget
AFILL() is an array function that fills the specified array with a single value of any data type (including an array, code block, or NIL) by assigning <expValue> to each array element in the specified range.
Warning! AFILL() cannot be used to fill multidimensional arrays. xClipper implements multidimensional arrays by nesting arrays within other arrays. Using AFILL() with a multidimensional array will overwrite subarrays used for the other dimensions of the array.
<aTarget> | is the array to be filled. |
<expValue> | is the value to be placed in each array element. It can be an expression of any valid data type. |
<nStart> | is the position of the first element to be filled. If this argument is omitted, the default value is one. |
<nCount> | is the number of elements to be filled starting with element <nStart>. If this argument is omitted, elements are filled from the starting element position to the end of the array. |
Returns : | AFILL() returns a reference to <aTarget>. |
See also : | AADD() AEVAL() DBSTRUCT() DIRECTORY() |
AINS(<aTarget>, <nPosition>) --> aTarget
AINS() is an array function that inserts a new element into a specified array. The newly inserted element is NIL data type until a new value is assigned to it. After the insertion, the last element in the array is discarded, and all elements after the new element are shifted down one position.
Warning! AINS() must be used carefully with multidimensional arrays. Multidimensional arrays in xClipper are implemented by nesting arrays within other arrays. Using AINS() in a multidimensional array discards the last element in the specified target array which, if it is an array element, will cause one or more dimensions to be lost. To insert a new dimension into an array, first add a new element to the end of the array using AADD() or ASIZE() before using AINS().
ARRAY(<nElements> [, <nElements>...]) --> aArray
ARRAY() is an array function that returns an uninitialized array with the specified number of elements and dimensions. If more than one <nElements> argument is specified, a multidimensional array is created with the number of dimensions equal to the number of <nElements> arguments specified. Any <nElements> that is itself an array creates a nested array.
In xClipper, there are several ways to create an array. You can declare an array using a declaration statement such as LOCAL or STATIC; you can create an array using a PRIVATE or PUBLIC statement; you can assign a literal array to an existing variable; or you can use the ARRAY() function. ARRAY() has the advantage that it can create arrays within expressions or code blocks.
<nElements> | is the number of elements in the specified dimension. The maximum number of elements in a dimension is 65000. Arrays in xClipper can have an unlimited number of dimensions. |
Returns : | ARRAY() returns an array of specified dimensions. |
See also : | AADD() ACLONE() ACOPY() ADEL() AEVAL() AFILL() AINS() |
ASCAN(<aArr>, <Expression>, [<nStart>], [<nCount>], [lBack]) --> <nStoppedAt>
ASCAN() scanns an array <aArr> for a value <Expression> or until a code block <Expression> returns TRUE and uses for comparions operator (=).
<aArr> | Array, is the target array |
<Expression> | is either a simple value to scan for, or code block |
<nStart> | Numeric, is the start element to scan. |
<nCount> | Numeric, is the number element to scan from the starting position. |
<lBack> | Logical, if TRUE - scan from end of array (default FALSE) |
Returns : | Returns a numeric value representing the array position of the last element scanned. |
ASIZE(<aTarget>, <nLength>) --> aTarget
ASIZE() is an array function that changes the actual length of the <aTarget> array. The array is shortened or lengthened to match the specified length. If the array is shortened, elements at the end of the array are lost. If the array is lengthened, new elements are added to the end of the array and assigned NIL.
ASIZE() is similar to AADD() which adds a single new element to the end of an array and optionally assigns a new value at the same time. Note that ASIZE() is different from AINS() and ADEL(), which do not actually change the array's length.
Note: ASIZE() only supports single-dimensional arrays.
ASORT(<aTarget>, [<nStart>],[<nCount>], [<bOrder>]) --> aTarget
ASORT() is an array function that sorts all or part of an array containing elements of a single data type. Data types that can be sorted include character, date, logical, and numeric.
If the <bOrder> argument is not specified, the default order is ascending. Elements with low values are sorted toward the top of the array (first element), while elements with high values are sorted toward the bottom of the array (last element).
If the <bOrder> block argument is specified, it is used to determine the sorting order. Each time the block is evaluated, two elements from the target array are passed as block parameters. The block must return true (.T.) if the elements are in sorted order. This facility can be used to create a descending or dictionary order sort. See the examples below.
When sorted, character strings are ordered in ASCII sequence; logical values are sorted with false (.F.) as the low value; date values are sorted chronologically; and numeric values are sorted by magnitude.
<aTarget> | is the array to be sorted. |
<nStart> | is the first element of the sort. If not specified, the default starting position is one. |
<nCount> | is the number of elements to be sorted. If not specified, all elements in the array beginning with the starting element are sorted. |
<bOrder> | is an optional code block used to determine sorting order. If not specified, the default order is ascending. |
Returns : | ASORT() returns a reference to the <aTarget> array. |
See also : | ASCAN() EVAL() |
ATAIL(<aArray>) --> Element
ATAIL() is an array function that returns the highest numbered element of an array. It can be used in applications as shorthand for <aArray>[LEN(<aArray>)] when you need to obtain the last element of an array.
<aArray> | is the array. |
Returns : | ATAIL() returns either a value or a reference to an array or object. The array is not changed. |
See also : | LEN() |
EMPTY(<exp>) --> lEmpty
The EMPTY() function has a number of uses. You can use it to determine if a user entered a value into a Get object before committing changes to a database file. It can also determine whether a formal parameter is NIL or unsupplied. In addition, it can test an array for zero-length.
<exp> | is an expression of any data type. |
Returns : | EMPTY() returns true (.T.) if the expression results in an empty value; otherwise, it returns false (.F.). The criteria for determining whether a value is considered empty depends on the data type of <exp> according to the following rules: List of Empty Values ------------------------------------------------------------------------ Data Type Contents ------------------------------------------------------------------------ Array Zero-length Character Spaces, tabs, CR/LF, or ("") Numeric 0 Date Null (CTOD("")) Logical False (.F.) Memo Same as character NIL NIL ------------------------------------------------------------------------ |
See also : | LEN() |
__Fledit( <aSrc>, <aList>) --> <aSelected>
__FlEdit() searches each element of <aList>[1] (DBS_NAME) in <aSrc>. If the element is found, this element of <aSrs> is added to destination array <aSelected>. According of other subelements (DBS_TYPE, DBS_LEN, DBS_DEC) isn't checked. Categories TCP is the set of functions for work with sockets.
For functions TCPListen() and TCPAccept() many thanks to Sergio Zayas.
<aSrc> | The initial array keeping all possible field's descriptions. |
<aList> | The Array keeping all fields to check. |
Returns : | The Array keeping all selectde field's descriptions. |
See also : | DBSTRUCT() |
FT_AADDITION( <aList1>, <aList2> [, <lTrimmer> [, <lCaseSens> ] ] ) ; --> aNewArray
This function will add the elements unique of aList2 with aList1. It returns a new array including all the elements of aList1 plus the unique elements of aList2.
<aList1> | is the primary array. |
<aList2> | is the secondary array. |
<lTrimmer> | is a logical value denoting whether leading or trailing spaces should be included in the comparison. If .T., then ignores spaces in comparison, defaults to .T., .F. includes spaces. |
<lCaseSens> | is a logical value denoting case sensitivity. If .T., then comparison is sensitive to case, defaults to .T., .F. ignores case. |
Returns : | An array of the union of aList1 and aList2. |
FT_AAVG( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) --> nAverage
This function is used to get a numeric average of selected or all elements of an array.
This routine requires FT_ASUM().
FT_ADESSORT( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) --> aSorted
This function is used to sort an array in descending order, i.e., Z-A
FT_AEMAXLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) ; --> nMaxlen
This function will measure each element of an array dimension and return the longest element.
<aArray> | is the array containing the elements to be measured. |
<nDimension> | is the array dimension to be measured, defaults to first dimension. |
<nStart> | is the starting array element to include, defaults to first array element. |
<nCount> | is the number of array elements to process from from <nStart>, defaults to remaining elements in array. |
Returns : | The length of the longest size element of an array. |
See also : | FT_AEMINLEN() |
FT_AEMINLEN( <aArray> [, <nDimension> [, <nStart> [, <nCount> ] ] ] ) --> nMinlen
This function will measure each element of an array dimension and return the shortest element.
<aArray> | is the array containing the elements to be measured. |
<nDimension> | is the array dimension to be measured, defaults to first dimension. |
<nStart> | is the starting array element to include, defaults to first array element. |
<nCount> | is the number of array elements to process from from <nStart>, defaults to remaining elements in array. |
Returns : | The length of the shortest size element of an array. |
See also : | FT_AEMAXLEN() |
FT_AMEDIAN( <aArray> [, <nStart> [, <nEnd> ] ] ) --> nMedian
This function sorts the elements of a numeric array and then returns the value in the middle element of the sorted array. If there is no exact middle value, then it returns the average of the two middle values. Half of the elements are > median and half are < median. A median average may more reflect a more useful average when there are extreme values in the set.
FT_ANOMATCHES( <aArray>, <bCompareBlock> ; [, <nStartIndex> [, <nEndIndex> ] ] ) --> nNoOfMatches
This function returns the number of array elements that, when passed to the supplied code block, cause that code block to return a .T. value.
<aArray> | is the array to be searched |
<bCompareBlock> | is a code block containing the expression for the array elements to be tested with. Each element is passed as a parameter to the block. If the block returns .T., the number of matches will be incremented by one. |
<nStartIndex> | is the first array item to include in the search, defaults to first element. |
<nEndIndex> | is the last array element to include in the search, defaults to all elements. |
Returns : | The number of elements that cause the code block to return .T. |
FT_AREDIT( <nTop>, <nLeft>, <nBottom>, <nRight>, <Array Name>, ; <nElem>, <aHeadings>, <aBlocks> [, <bGetFunc> ] ) --> xElement
This function allows you to position yourself in an array, add and delete rows with the <F7> and <F8> keys, and pass a UDF with information to edit the individual gets.
<nTop> | , <nLeft>, <nBottom>, <nRight> are coordinates for TBrowse |
<Array Name> | is name of 2 dimensional to array edit |
<nElem> | is pointer for element in array |
<aHeadings> | is array of column headings |
<aBlocks> | is array of blocks describing each array element [ <bGetFunc> ] is get editing function for handling individual elements |
Returns : | Value of element positioned on when exit FT_AREDIT() The type of this value depends on what is displayed. |
FT_ASUM( <aArray> [, <nStartIndex> [, <nEndIndex> ] ] ) --> nSum
This function is to sum the elements of a numeric array or to sum the lengths of a character array.
FT_RESTARR( <cFileName>, <nErrorCode> ) --> aArray
FT_RESTARR() restores an array which was saved to a disc file using FT_SAVEARR().
[10/1/92 Librarian note:
This function does not appear to work with multi-dimensional arrays. If you'd care to modify it to support this feature, please do and send it to Glenn Scott 71620,1521.]
<cFileName> | is a DOS file name. |
<nErrorCode> | will return any DOS file error. All arguments are required. |
Returns : | Return an array variable. |
See also : | FT_SAVEARR() |
FT_SAVEARR( <aArray>, <cFileName>, <nErrorCode> ) --> lRet
FT_SAVEARR() saves any Clipper array, except those containing compiled code blocks, to a disc file. The array can be restored from the disc file using FT_RESTARR().
[10/1/92 Librarian note:
This function does not appear to work with multi-dimensional arrays. If you'd care to modify it to support this feature, please do and send it to Glenn Scott 71620,1521.]
<aArray> | is any Clipper array except those containing compiled code blocks. |
<cFileName> | is a DOS file name. |
<nErrorCode> | will return any DOS file error. All arguments are required. |
Returns : | .F. if there was a DOS file error or the array contained code blocks, otherwise returns .T. |
See also : | FT_RESTARR() |
LEN(<cString> | <aTarget>) --> nCount
LEN() is a character and array function that returns the length of a character string or the number of elements in an array. With a character string, each byte counts as one, including an embedded null byte (CHR(0)). By contrast, a null string ("") counts as zero.
For an array, LEN() returns the number of elements. If the array is multidimensional, subarrays count as one element. This means that the LEN() of a nested or multidimensional array simply returns the length of the first dimension. To determine the number of elements in other dimensions, use LEN() on the subarrays as shown in the example below. Note that nested arrays in xClipper need not have uniform dimensions.
<cString> | is the character string to count. |
<aTarget> | is the array to count. |
Returns : | LEN() returns the length of a character string or the number of elements in an array as an integer numeric value. If the character string is a null string ("") or the array is empty, LEN() returns zero. |
See also : | AADD() ASIZE() LTRIM() RTRIM() |
MAP() --> <oObject>
MAP() createst new empty object (associative array) and returns it.
MAPMODIFY(<oObj>, <lMode>) --> <lOldMode>
MAPMODIFY() includes/excludes the control mode for attributes when this attributes try changes.
If <lMode> is TRUE and source object <oObj> contents method <Modify>, then before changes attributes value automatically called method oObj:Modify(<nHashAttr>, <vNewValue>). When <nHashAttr> is the attribute hash code, <vNewValue> new value, what must be assigned. The <Modify> method must returned realy value for modifyed attribute.
TYPE(<cExp>) --> cType
TYPE() is a system function that returns the type of the specified expression. It can test expression validity as long as the expression uses xCLIPPER.LIB functions and does not reference local or static variables, user-defined functions, or built-in functions supplied in EXTEND.LIB.
TYPE() is like VALTYPE() but uses the macro operator (&) to determine the type of the argument. This precludes the use of TYPE() to determine the type of local and static variables. VALTYPE(), by contrast, evaluates an expression and determines the data type of the return value. This lets you determine the type of user-defined functions as well as local and static variables.
<cExp> | is a character expression whose type is to be determined. |
<cExp> | can be a field, with or without the alias, a private or public variable, or an expression of any type. |
Returns : | TYPE() returns one of the following characters: TYPE() Return Values ------------------------------------------------------------------------ Returns Meaning ------------------------------------------------------------------------ A Array B Block C Character D Date L Logical M Memo N Numeric O Object U NIL, local, or static UE Error syntactical UI Error indeterminate ------------------------------------------------------------------------ |
See also : | VALTYPE() |
VALTYPE(<exp>) --> cType
VALTYPE() is a system function that takes a single argument, evaluates it, and returns a one-character string describing the data type of the return value. It is similar to TYPE(), but differs by actually evaluating the specified argument and determining the type of the return value. For this reason, you can determine the type of local and static variables, user-defined functions, and EXTEND.LIB functions. TYPE(), by contrast, uses the macro operator (&) to evaluate the type of its argument. Note that if the argument does not exist, an error ("undefined error") will occur, unlike TYPE which will return "U."
<exp> | is an expression of any type. |
Returns : | VALTYPE() returns a single character representing the data type returned by <exp>. VALTYPE() returns one of the following characters: VALTYPE() Return Values ------------------------------------------------------------------------ Returns Meaning ------------------------------------------------------------------------ A Array B Block C Character D Date L Logical M Memo N Numeric O Object U NIL ------------------------------------------------------------------------ |
See also : | TYPE() |