| Subject |
Re: FIND LEVEL OF A TABLE (DBF) |
| From |
Mervyn Bick <invalid@invalid.invalid> |
| Date |
Sun, 27 Nov 2022 11:12:11 +0200 |
| Newsgroups |
dbase.getting-started |
| Attachment(s) |
table_level.prg |
On 2022/11/27 01:05, ED wrote:
> HOW AND/OR WHERE CAN I SEE THE TRUE TABLE LEVEL?
Please turn off the damn CapsLock when you post messages here. Using
all uppercase is considered to be shouting. I, for one, usually ignore
people who shout at me.
If you didn't make any typos when you tried the code I posted previously
it suggests that you are still using a version of dBASE for DOS.
If the attached program, which uses the low-level file commands, doesn't
work it suggests that you are using a version of dBASE for DOS that
didn't include the the low-level file functions. I have no idea when
they first featured but it was perhaps in dBASE IV.
If the program doesn't run you will need to download a HEX editor such
as XVI and look inside the files at the headers yourself. The first
byte will be (in HEX) 04 or 84 for level 7 tables. The first byte will
be 03 for level 3, 4 or 5 tables. The 30th byte will be blank for level
3 tables and will be 57 for level 4 or 5 tables.
Although the BDEAdmin program has separate settings for level 4 and
level 5 I can't find any difference in the file headings and I haven't
been able to find documentation setting out the differences.
To run the attached program once you've saved it, type the following at
the dot prompt
do table_level with "whatever.dbf"
Mervyn.
| clear
parameters cFile
if argcount() = 0
? 'Table name required'
?
? 'e.g do table_level with "whatever.dbf"'
return
endif
if file(cFile)
h = fopen(cFile, "R")
else
? cFile+' not found.'
return
endif
nByte1 = bitand(asc(fread(h,1)),15)
fseek(h,29,0)
nByte2 = asc(fread(h,1))
if nByte1 = 4
cLevel = '7'
elseif nByte1 = 3 and nByte2 = 87
cLevel = '4 or 5'
elseif nByte1 = 3
cLevel = '3'
endif
? cFile+ ' is a level '+cLevel+' table'
fclose(h)
|
|