BB___Drives

=Drives$= toc

Description
> Contains the letters of all the drives on the computer in use. Drives$ is a special system variable. Use Drives$ anywhere in a program as you would any other variable.

Usage

 * 1) print Drives$

Hints
> (changes in available drives will show only after restarting program)
 * 1) Drives$ is a reserved word and cannot be used as a user-defined variable in a program.
 * 2) The contents of the variable are not updated, if a removable drive, USB stick and similar, is added or removed!

Example
code format="lb" ' A simple example to check if user's computer has an "a:" drive. if instr(LOWER$(Drives$), "a:") then print "There's an a: drive." else print "No a: drive available." end if end code

Useful Functions
Here is an example from the JB Help file. It searches the user's computer for a list of drive letters and displays the list in a listbox. The user can select a drive letter, possibly to save the current file. code format="lb" 'a simple example illustrating the use of the Drives$ variable

dim letters$(25) index = 0 while word$(Drives$, index + 1) <> "" letters$(index) = word$(Drives$, index + 1) index = index + 1 wend

statictext #win, "Double-click to pick a drive:", 10, 10, 200, 20 listbox #win.list, letters$(, [selectionMade], 10, 35, 100, 150   open "Scan drive" for dialog as #win

input r$

[selectionMade]

close #win end

code