8 |
The LA Fox Developer Newsletter
August 1997
Visual FoxPro HOT TIP
from Brent Vollrath, FoxPro Development Manager
I had a situation that required the opening and searching of a
large number of files. I needed to search all different types of
files, so I was using low-level file functions to handle the opening
(FOPEN) and searching (FREAD). When everything was
completed, I was a bit disappointed with the performance of the
search. While trying to optimize the code, I stumbled across
something quite interesting.
It turned out that the opening of the files took longer than the
actual search. I looked back at my code and saw that I was
opening files read only and unbuffered:
FOPEN(<FileName>, 0)
There can’t be a quicker way to open a file than that, right?
WRONG! I found that by opening the files read/write and
unbuffered, the performance of my search increased substan-
tially:
FOPEN(cFiIeName>, 2)
System Drives
(Con’t from page 4)
If the drive is va%id, call the
Get Drive Type function to see
what type of drive it is.
IF BITTEST(InValidDrives, InCounter)
lcDriveLetter=CHR(lnCounter+65)+”:”
*_
Call the routine to get the
drive type.
lnDriveType=GetDriveType(lcDriveLetter)
lcMsg
=
“Drive "+IcDriveLetter+" is a”
DO CASE
CASE InDriveType
=
1
lcMsg
=
IcMsg
+
“
Hard Disk (non-”
+
“removable) Drive.”
CASE InDriveType
=
2
lcMsg
=
IcMsg
+“
Floppy Disk”;
+
“(removable) Drive.”
CASE InDriveType
=
3
lcMsg
=
IcMsg
+“
partitioned”;
+
“Hard Drive.”
CASE InDriveType
=
4
lcMsg
=
lcMsg
+
“
Network Drive.”
CASE InDriveType
=
5
lcMsg
=
lcMsg
+
“CD-ROM Drive.”
OTHERWISE
IcMsg
=
lcMsg
+
“n unknown type.”
ENDCASE
?IcMsg
ENDIF
ENOFOR
RETURN
(Con’t, next column)
Job Opportunity
FoxPro Senior programmer
-
Los Angeles area (5 miles north of
downtown in the Silverlake area). Immediate opening in vertical
market software company specializing in service and subcontract-
ing businesses. Minimum of 5
years experience in
business
related programming. SBT accounting systems experience pre-
ferred. FoxPro 2.6
Windows/DOS required. Visual
experience a plus
we will be migrating to VFP 5 in the next few months. Some
working knowledge of network and operating system environments
a plus. Accounting background or familiarity a plus. Work well with
resellers and endusers. Experience with online support via PC
Anywhere.
Company in business for 14 yrs.
Salary $45-52K plus benefits.
Some flex hours possible (4 9’s and a midweek 4 for example).
Call 213-484-1194. mailto:mark@5-star.com
Best Regards,
Mark Pettibone,
Five Star Software
http://www.5-star.com
Professional Software for Service and Subcontracting Businesses
Distributor for WebTV
System Drives
(Con’t from prev. column)
fEd. Note: Charlie Parker is a Senior Practice Partner for
Fowler Software Design in Eldorado Springs, Colorado. He has
28 years of computer systems experience and has worked with
FoxPro for the last 3 years. He can be reached at
CParker@FowlerSoftware.com.]
Out and About
(Con’t from page 2)
Paul Allen,
Seattle Seahawks owner, noted Jimi Hendrix freak,
and, oh yes, co-founder of Microsoft, announced plans to sell of
5.45 million shares of Microsoft for an estimated bottom-line
figure of $781 million. That only leaves the world’s sixth-richest
(that’s right, sixth) man with about 94 million shares worth an
estimated $13.5 billion (that’s right, billion).
If you’re looking for an off-the-wall book, try
The Weird Wide
Web by
Erfert Fenton and David Pogue. It celebrates the
craziness of the Internet by chronicling the more “unique” sites
on the web: The Page O’Spam site; The Exploding Head Page
(which features such celebrities as Rush Limbaugh and Bill
Gates); the Captain James T. Kirk Sing-Along Page. Yes,
these are just a few of the wild and crazy sites to be found in
the pages of this book.
Truly Weird!!
Page 8
|
8 |