Liberty BASIC Help Online |
Drives$
Description:
Drives$ is a system variable. It can be used like any other variable. Use it in expressions, print it, perform functions on it, etc. It is special in that it contains the drive letters for all the drives installed in the computer in use.
For example:
print Drives$
Will in many cases produce:
a: b: c:
It can be used to provide a way to select a drive like this:
'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
Copyright (C) 2003 Shoptalk Systems
Liberty BASIC - http://www.libertybasic.com/