Volume

From REALbasicWiki

Jump to: navigation, search

Contents

[edit] Prototype

Function Volume( volumeNumber as Integer ) As FolderItem

[edit] Description

The Volume function returns a FolderItem that represents the mounted volume whose number is volumeNumber. This function can be used in conjunction with the VolumeCount function to loop through the volumes currently mounted by the operating system.

[edit] Discussion

Volume(0) returns the boot volume.


[edit] Sample Code

This code displays the names of all the mounted volumes.

 dim volumeNames() as String
 for i as Integer = 0 to VolumeCount - 1
   dim f as FolderItem = Volume(i)
   if f is nil then
     continue
   end if
   volumeNames.Append f.Name
 next
 MsgBox Join(volumeNames, ", ")
Personal tools
related