DbCopySDF Function | |
Export records to a new SDF file.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION DbCopySDF(
cTargetFile,
acFields,
cbForCondition,
cbWhileCondition,
nNext,
nRecord,
lRest,
lNoOpt
) AS LOGIC CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static bool DbCopySDF(
Usual cTargetFile = default,
Usual acFields = default,
Usual cbForCondition = default,
Usual cbWhileCondition = default,
Usual nNext = default,
Usual nRecord = default,
Usual lRest = default,
Usual lNoOpt = default
)
Request Example
View SourceParameters
- cTargetFile (Optional)
- Type: Usual
The name of the target file, including an optional drive, directory, and extension. See SetDefault() and SetPath() for file searching and creation rules.
The default extension for database files is determined by the RDD .
For text files, it is .TXT.
If cTargetFile does not exist, it is created.
If it exists, this function attempts to open the file in exclusive mode and, if successful, the file is overwritten without warning or error.
If access is denied because, for example, another process is using the file, NetErr() is set to TRUE.
- acFields (Optional)
- Type: Usual
A list of fields to copy to cTargetFile.
The default is all fields.
- cbForCondition (Optional)
- Type: Usual
A code block that defines a condition that each record within the scope must meet in order to be processed. - cbWhileCondition (Optional)
- Type: Usual
A code block that defines another condition that each record must meet in order
to be processed.
As soon as a record is encountered that causes the condition to fail, the operation
terminates.
If no scope is specified, cbWhileCondition changes the default scope to lRest.
You define the scope using one of these three, mutually exclusive arguments.
The default is all records.
- nNext (Optional)
- Type: Usual
The number of records to process, starting at nRecord.
Specify 0 to ignore this argument.
- nRecord (Optional)
- Type: Usual
A single record number to process. Specify 0 to ignore this argument. - lRest (Optional)
- Type: Usual
TRUE processes only records from nStart to the end of the file.
FALSE processes all records.
- lNoOpt (Optional)
- Type: Usual
Disable (Rushmore) optimizations (not supported yet).
Return Value
Type:
Logic
TRUE if successful; otherwise, FALSE.
Remarks Tip |
---|
The nNext, nRecord, and lRest arguments are mutually exclusive. You should not pass all three of them.
And if you pass the cbWhile argument then this also controls the scope behavior.
|
DBCopySDF() is the functional equivalent of the COPY TO SDF command.
It is the same as DBCopy() except that it copies records to an SDF file. See COPY TO and DBCopy() for more information.
Examples
The following example copies records from the current database file to an SDF file:
1USE Test NEW
2IF Used()
3 DBCopySDF("newsdf")
4ENDIF
See Also