Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug on memo update
Message
From
18/10/2004 11:02:57
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro Beta
Miscellaneous
Thread ID:
00950993
Message ID:
00952281
Views:
32
>>>Fabio,
>>>
>>>What exactly bug is? Can you describe it? Why do you expect "a fixed 1.00 ratio" ? Is it covered somewhere in VFP docs? It would be also helpfull if your trim repro code of irrelevant stuff.
>>>
>>>>Bug/Issue : 1 of 22
>>>>
>>>>This is present on VFP6-7-8-9
>>>>
>>>>Expected results : a fixed 1.00 ratio
>>>>
>>>>Repro code:
>>><snip>
>>
>>Sergey,
>>no bug of programming, this show that the VFP algorithm is inefficient.
>>A simple one exists workaround in order
>>to resolve the thing and give always 1.00.
>
>Fabio,
>
>So far you didn't show anything becides posting a bunch of code that does something you cannot explain. And why do you call it a bug if by your admition it's not a bug?

Because I have interpreted in a soft way the VFP behavior.
However I try to explain it to you.

A memo it is allotted to blocks ( or pages ), of fixed dimension = SYS(2012)
( memo header 06-07 ).

For simple example, use only One BLOCKSIZE ( see my code ).
* VFP current code
IF LEN(Deleted.memofield)>=LEN(inserted.memofield) && with MSSQL language
  * overwrite memo with inserted.memofield
ELSE
  * move the memo's DBF pointer to end of file, 
  * append the inserted.memofield ( the old block is a zombi file area )
ENDIF
* set Length of memo (in bytes) ( memo block header 04-07 ) to new LEN(inserted.memofield) 
ENDIF
because the memo file is a file of pages = N*SYS(2012),
i expected a best code, like this:
* VFP expected correct code
IF SYS(2012)*CEILING(LEN(Deleted.memofield)/SYS(2012))>=LEN(inserted.memofield) 
  * overwrite memo with inserted.memofield
ELSE
  * move the memo's DBF pointer to end of file, 
  * append the inserted.memofield ( the old block is a zombi file area )
ENDIF
* set Length of memo (in bytes) ( memo block header 04-07 ) to new LEN(inserted.memofield) 
ENDIF
if this coding is used, my repro program return a fixed 1.00,
and the probability of memo bloat it becomes very more small.
A simple example:
- i build a cursor/table with a memo field only.
- i known that the size of the memo string is bounded to 8000 characters.
- then SET BLOCKSIZE TO 16 ( 8192 )
- with current VFP you have bloat, with expected correct code you have none bloat!

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform