Click or drag to resize

DbServer.Sort Method (String, Array, Usual, Usual, Usual)

X#
Copy records to another database file in sorted order. If neither conditions nor scope is passed to the method, it is subject to the general server scope.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD Sort(
	cTarget AS STRING,
	aFieldList AS ARRAY,
	 cbForBlock AS USUAL,
	 cbWhileBlock AS USUAL,
	 uScope AS USUAL
) AS LOGIC
Request Example View Source

Parameters

cTarget
Type: String
The file to which the records is copied.The file to which the records is copied.
aFieldList
Type: Array
An array of fields from the source file that are to be included. The default is all fields.
cbForBlock
Type: Usual
The condition evaluated for each record in the scope; if TRUE, the record is included in the processing. It provides the same functionality as the FOR clause of record processing commands.
cbWhileBlock
Type: Usual
The condition evaluated for each record from the first record until the condition returns FALSE. It provides the same functionality as the WHILE clause of record processing commands.
uScope
Type: Usual
The range of records to process, providing the same functionality as the ALL, REST and NEXT clauses of record processing commands.
ValueDescription
DBSCOPEALLThe scope is all the records in the table. This is the default, although if a WHILE condition is specified, the scope becomes DBSCOPEREST.
DBSCOPERESTThe scope is the remaining records in the table from the current position.
<nRecords> The scope is the next nRecords records.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE (although some records still might have been processed).
Remarks
Sends a NotifyIntentToMove message before the operation.
Sends a NotifyRecordChange message upon completion.
This method does not open the new file, it simply creates the file on disk. If you want to open it afterwards, you simply instantiate it directly:
X#
1oDB1:Sort(oFSTarget)
2oDB2 := DBServer{oFSTarget}
See Also