Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Spot the difference.
Message
 
To
19/10/2000 11:57:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00431534
Message ID:
00431805
Views:
8
Robin,

You can Try something like this:

lnDBFType=dbftype(yourtable)

do case
case lnDBFType=-2 && Invalid file name
case lnDBFType=-1 && Cannot open file
case lnDBFType=48 && VFP Table's first byte is 0x00000030
otherwise && There are different values for 2.6 tables
endif

function dbftype
parameters lcFileName
private lnFH, lcChar

* Should work with visual and 2.6

if type('lcFileName')#'C' or not file(lcFileName)
return -2
endif
lnFH=fopen(lcFileName)
if lnFH=-1
return -1
endif
lcChar=fgets(lnFH, 1)
=fclose(lnFH)
return asc(lcChar)

HTH
Hugo
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Previous
Reply
Map
View

Click here to load this message in the networking platform