Click or drag to resize

FileSpec.Drive Property (Typed)

X#
A string representing the drive defined to this file specification.

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOSystemClasses (in XSharp.VOSystemClasses.dll) Version: 2.19
Syntax
 VIRTUAL PROPERTY Drive AS STRING GET SET 
Request Example View Source

Property Value

Type: String
A string representing the drive defined to this file specification.
Remarks
A string representing the drive defined to this file specification. The drive may have been assigned explicitly or as part of a longer file specification (assigned either as an instantiation parameter or as part of the file name or full path). When accessing FileSpec:Drive, the requested drive is returned with a trailing colon. When assigning FileSpec:Drive, you can specify a drive with or without a colon. Assigning a NULL_STRING (or NIL) to the drive means that the drive is unknown or unspecified; the various functions and objects that use the file specification to locate the file looks on whatever default drive would apply if a file name without a drive is specified.
Examples
To copy selected records from a file from one disk drive to another — using the same file name and directory — you could do this:
X#
 1// Define original file
 2oFSSource := FileSpec{"c:\data\customer"}
 3// Copy path for target file
 4oFSTarget := FileSpec{oFSSource:FullPath}
 5// Change drive for target file
 6oFSTarget:Drive := "d"
 7// Open original file
 8oDBSource := DBServer{oFSSource}
 9// Copy selected records to target file
10oDBSource:CopyDB(oFSTarget,,{||STATE="NY"})
See Also