VoDbOrderInfo Function (DWord, String, Usual, Usual) | |
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
public static bool VoDbOrderInfo(
uint kInfoType,
string cIndexFile,
Usual uOrder,
ref Usual ptrRetVal
)
Request Example
View SourceParameters
- 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.
Constant | Description |
---|
DBOI_CONDITION | Returns 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_EXPRESSION | Returns the order key expression of the specified order as a string. |
DBOI_FILEHANDLE | Returns the handle of the specified index file as an IntPtr. |
DBOI_FILESTREAM | Returns the filestream of the specified index file. |
DBOI_FULLPATH | Returns the full path of the specified index file as a string. |
DBOI_HPLOCKING | Returns a logical flag indicating whether the specified index file uses the high performance index locking schema (see IndexHPLock() function). |
DBOI_INDEXEXT | Returns the default index file extension as a string. |
DBOI_INDEXNAME | Returns the name of the specified index file as a string. |
DBOI_ISCOND | Returns a logical flag that determines whether the specified order was defined using a for condition. |
DBOI_ISDESC | Returns 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_KEYCOUNT | Returns the number of keys in the specified order. |
DBOI_KEYDEC | Returns the number of decimals in the key of the specified order. |
DBOI_KEYSINCLUDED | Returns 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_KEYSIZE | Returns the size of the key in the specified order as a number. |
DBOI_KEYTYPE | Returns the data type of the key in the specified order as a string. |
DBOI_KEYVAL | Returns the key value of the current record in the specified order. |
DBOI_LOCKOFFSET | Returns the locking offset (see NewIndexLock() function) for the specified index file as a numeric value. |
DBOI_NAME | Returns the name of the specified order as a string. |
DBOI_NUMBER | Returns the numeric position of the specified order in the order list. |
DBOI_ORDERCOUNT | Returns the number of orders defined in the specified index file. |
DBOI_POSITION | Returns the logical record number of the current record within the specified order. |
DBOI_RECNO | Returns the physical record number of the current record within the specified order. |
DBOI_SCOPEBOTTOMs | Returns the bottom boundary of the scope for the specified order. |
DBOI_SCOPETOP | Returns the top boundary of the scope for the specified order. |
DBOI_SETCODEBLOCK | Returns the key for the specified order as a code block. |
DBOI_UNIQUE | Returns a logical flag indicating whether the specified order has the unique attribute set. |
DBOI_USER | For customizations. |
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:
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
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