Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table header question
Message
From
23/09/2004 11:16:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00945261
Message ID:
00945390
Views:
19
>>>lnCalculatedReccount = (lnFileSize-(lnFirstRecPos+1))/lnRecordSize
>>>lnCalculatedReccount = FLOOR((lnFileSize-(lnFirstRecPos+1))/lnRecordSize)
>>>
>>>I want to repair damage to my headers, so which answer is correct?
>
>>John,
>>Floor() one is the correct one. However +1 there was related with Fox2x tables. Since now everyone assumes and uses VFP tables I edited code on wiki site and dropped it. Thanks for reminding.
>>lnCalculatedReccount = FLOOR((lnFileSize-lnFirstRecPos)/lnRecordSize)
>>
>>Floor is necessary because sometimes table is off by one record due to incomplete record at end (ie: recsize=100 but last record lenght is say 70). VFP might not say anything on that situation but it's an error IMHO.
>>Cetin
>
>Hello Cetin
>
>I've been using ROUND(). For example, a table has a file size of 883810, a first data pos of 1000, and a record size of 306.
>
>(883810 - (1000 + 1))/306 = 2884.996
>
>FLOOR() would make that 2884 while there are actually 2885 records. ROUND(2884.996, 0) makes it 2885 which is correct.
>
>Have I got this right?
>John

John,

" However +1 there was related with Fox2x tables...

lnCalculatedReccount = FLOOR((lnFileSize-lnFirstRecPos)/lnRecordSize)"

New edited code doesn't have it (edited upon you reminding).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform