virtualdrives AddDrive property
Return to Introduction  Previous page  Next page
Applies to
dcVirtualDrives component.  

function AddDrive(Drive: Char; Target: String): Boolean;  
   // Returns True if successful  

The AddDrive method used to add the new virtual drive to the file system, or redefine existing virtual drive to another target. Drive parameter specifies the new drive letter and Target - target directory which should be used as separate disk. Function returns True if succeeded or False otherwise.  

Following line will define new virtual drive for directory with your projects:  
dcVirtualDrives1.AddDrive('Z''C:\Program Files\Borland\Delphi 5\Projects');  

tip To add the virtual drive at design-time - click the right mouse button on the component image and select "Add virtual drive" menu item:  

See also
DeleteDrive method;  
Drive, Target and VirtualDrives properties.