Click or drag to resize

VoDbOrderInfo Function (DWord, String, Usual, Usual)

X#
Return information about index files and the orders in them.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION VoDbOrderInfo(
	kInfoType AS DWORD,
	cIndexFile AS STRING,
	uOrder AS USUAL,
	ptrRetVal REF USUAL
) AS LOGIC
Request Example View Source

Parameters

kInfoType
Type: DWord
Determines what type of information is retrieved. This should be one of the DBOI_ constants listed in the remarks section
cIndexFile
Type: String
The name of an open index file (only the eight-letter file name is needed).
Use this argument with cOrder to remove ambiguity when there are two or more orders with the same name in different index files.
To omit the argument, specify NULL_STRING.
uOrder
Type: Usual
The name of the order about which you want to obtain information or a number representing its position in the order list.
To omit the cOrder | nPosition argument, specify NIL.
ptrRetVal
Type: Usual
A pointer to a polymorphic value.
This value will receive the requested information if the function is successful and will be unchanged otherwise.
If you just want to retrieve information, this value must be NIL before calling the function.
Using a non-NIL value is not currently supported by any of the supplied RDDs .
This feature is reserved for RDDs that allow you to change the information rather than just retrieve it.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
VODBOrderInfo() is similar to DBOrderInfo().
This function, however, does not call the error handler and will not, therefore, produce a runtime error message or create an error object if it fails. Thus, it may be important to check the return value to determine if the function succeeded.
The global structure, StrucErrInfo, will contain needed information regarding any error that occurs. See DBOrderInfo() for more information.
ConstantDescription
DBOI_CONDITIONReturns the for condition of the specified order as a string.
DBOI_CUSTOM Returns and optionally sets the logical flag indicating whether the specified order is custom built (for RDDs that support custom built orders). Note that although you can turn the custom built flag on for a standard order by specifying TRUE for the uNewSetting argument, you cannot turn a custom built order into a standard order. Specifying FALSE for uNewSetting is the same as not specifying the argument at all—both return the current setting.
DBOI_EXPRESSIONReturns the order key expression of the specified order as a string.
DBOI_FILEHANDLEReturns the handle of the specified index file as an IntPtr.
DBOI_FILESTREAMReturns the filestream of the specified index file.
DBOI_FULLPATHReturns the full path of the specified index file as a string.
DBOI_HPLOCKINGReturns a logical flag indicating whether the specified index file uses the high performance index locking schema (see IndexHPLock() function).
DBOI_INDEXEXTReturns the default index file extension as a string.
DBOI_INDEXNAMEReturns the name of the specified index file as a string.
DBOI_ISCONDReturns a logical flag that determines whether the specified order was defined using a for condition.
DBOI_ISDESCReturns the logical flag that determines if the specified order is descending. For drivers that support dynamically setting the descending flag at runtime, specify the new value as a logical, using DBServer:OrderInfo(DBOI_ISDESC, [<oFSIndexFile> | <cIndexFile>], [<cOrder> | <nPosition>], <lNewSetting>). The current setting is returned before it is changed.
DBOI_KEYCOUNTReturns the number of keys in the specified order.
DBOI_KEYDECReturns the number of decimals in the key of the specified order.
DBOI_KEYSINCLUDEDReturns the number of keys included in the specified order so far. This is primarily useful for conditional orders. It can be used during the status display process (with the EVAL clause of the INDEX command).
DBOI_KEYSIZEReturns the size of the key in the specified order as a number.
DBOI_KEYTYPEReturns the data type of the key in the specified order as a string.
DBOI_KEYVALReturns the key value of the current record in the specified order.
DBOI_LOCKOFFSETReturns the locking offset (see NewIndexLock() function) for the specified index file as a numeric value.
DBOI_NAMEReturns the name of the specified order as a string.
DBOI_NUMBERReturns the numeric position of the specified order in the order list.
DBOI_ORDERCOUNTReturns the number of orders defined in the specified index file.
DBOI_POSITIONReturns the logical record number of the current record within the specified order.
DBOI_RECNOReturns the physical record number of the current record within the specified order.
DBOI_SCOPEBOTTOMsReturns the bottom boundary of the scope for the specified order.
DBOI_SCOPETOPReturns the top boundary of the scope for the specified order.
DBOI_SETCODEBLOCKReturns the key for the specified order as a code block.
DBOI_UNIQUEReturns a logical flag indicating whether the specified order has the unique attribute set.
DBOI_USERFor customizations.
Tip Tip
DBOI_USER is a constant that returns the minimum value that third-party RDD developers can use can use for customizations. Values less than DBOI_USER are reserved for X# development.
Examples
The following examples return order access information:
X#
 1FUNCTION ShowOrderInfo() AS VOID
 2    LOCAL uResult AS USUAL
 3    uResult := NIL
 4    IF VODBOrderInfo(DBOI_EXPRESSION,"",0,@uResult)
 5        ? "IndexKey(): ", uResult
 6    ELSE
 7        DoError()
 8    ENDIF
 9    // Record number for specified position:
10    uResult := 100
11    IF VODBOrderInfo(DBOI_RECNO,"",0,@uResult)
12        ? "Record number of position 100: ", uResult
13    ELSE
14        DoError()
15    ENDIF
16    IF VODBOrderInfo(DBOI_FULLPATH,"",0,@uResult)
17        ? "FULLPATH of index file: ", uResult
18    ELSE
19        DoError()
20    ENDIF
21    RETURN
22STATIC FUNCTION DoError() AS USUAL
23    LOCAL uRetCode<br />
24AS USUAL
25    LOCAL oError  <br />
26AS USUAL
27    oError := ErrorBuild(@strucErrInfo)
28    oError:FuncSym := #VODBOrderInfo
29    RETURN EVAL(ErrorBlock(), oError)
See Also