Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Programmer's Encyc Home
guest| Join | Help | Sign In
Liberty BASIC Programmer's Encyc
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members

Home

General Tutorials
Advanced Tutorials
GUI Programming
Graphics and Games
Strings and Text
Numbers and Math
Using Files
Windows API
Communications
Programmer's Tools

Articles by Date
FAQs
Rosetta Code
General Articles
Newsletters Contents

Table of Contents
Demos

Submit Articles
TOS and License

Drives

Edit 1 …
  • 1 Tags
    • tutorials
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

Alyce Alyce May 5, 2011

=Drives$= [[toc]] We can learn which drives are installed on a computer natively with the Drives$ statement. ==Using Drives$== Liberty BASIC has a special variable called Drives$ which contains a string with a list of drives on the computer. This variable is filled when the program starts. It does not change if the user installs or removes drives during the program's execution. With the advent of removable drives like jump drives, removable CD drives, etc. it may be necessary to check for installed drives at different points during the run of a program. If an updated list of drives is critical during a program's run, use the GetLogicalDriveStringsA API function. Run this single-line program to see which drives are installed. Insert a jump drive, CD, DVD, etc. and run the program again to see how it changes. [[code format="lb"]] print "Drives$ holds this information: ";Drives$ [[code]] ==Extracting Information from Drives$== Drives$ returns a single string containing all drive letters, separated by spaces. We can use WORD$() to extract the individual drive letters. [[code format="lb"]] print "Drives$ holds this information: ";Drives$ d$=Drives$ i = 1 'start with first drive in string while word$(d$,i)<>"" print word$(d$,i) i = i + 1 wend [[code]]
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://lbpe.wikispaces.com/ are licensed under a Custom License.
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...