Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapter Class - some explanations please
Message
 
À
11/03/2003 11:24:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00764286
Message ID:
00764317
Vues:
18
Hi Jim

I think I can help explain some of these. See my inline comments.


>I am having trouble getting my head around the whole CursorAdapter Class and its (intended) usage.
>While I expect that I will have some luck in learning nuances as I play with it, there are some "concepts" that I'd like to have elaborated in a more 'official' manner, and I request them below:
>
>CursorAttach Method
>The top description says "Attaches an existing cursor to the current ...".
>Q1 What does it mean to "attach" a cursor?

My understanding is that once a cursor is attached to a cursoradapter changes in the cursor will trigger the events in the attached cusrsoradapter and when the cursor adapter is destroyed the cursor is closed.

>
>Q2 What are the implications on (usage of) the specified cursor outside of the CursorAdapter instance to which it is "attached"?

It will trigger the events of the attached cursor adapter. So if you insert records in the cursor from the command window for example and then issue a tableupdate the base table will contain the new records.

>
>Under the "lInheritCursorProperties" parameter description is written "Specifies whether you wish to keep or discard the properties of the cursor or table being attached. ".
>Q3 What specific "properties is this referring to?
>
>Under the "Remarks", first line, it says "A cursor or table can have only one instance of a CursorAdapter object attached to it...".
>Q4 Is the cursor or table 'attached TO the CursorAdapter' or is the CursorAdapter 'attached to the table or cursor'?
>
>Under the "Remarks", third paragraph, it says "Calling CursorAttach closes the currently attached cursor. To preserve the currently attached cursor, call CursorDetach first.".
>Q5 What does it mean to "preserve the currently attached cursor..."?

When the cursorattach method is called the current cursor is closed and deleted from disk. However, if you detach it first it continues to exist and will only be deleted once you close it manually.

>
>CursorDetach Method
>The top description says "Frees the currently attached cursor from the current instance of CursorAdapter.".
>Q6 What does "frees" mean?... What are the implications on the cursor (that is) detached?

It means the cursor activity will no longer trigger events in the cursoradapter and will not be closed and deleted when the cursoradapter is destroyed.

>
>Under the "Remarks", first line, it says "Visual FoxPro preserves all settings, such as buffering and so on, available to a normal cursor in the freed cursor..
>Q7 What 'settings' are 'preserved' ("and so on" doesn't really tell me)?
>
>Q8 Is there any difference between a "normal cursor" and a "freed cursor"?

My impression is that they are the same.

>
>Under the "Remarks", second paragraph, it says "Visual FoxPro preserves all unsaved changes. For example, you do not need to call the TABLEUPDATE( ) function before detaching the cursor.".
>Q9 I interpret this to mean that I can later continue to work with the (detached) cursor as a normal cursor in every respect. Is this correct?
>
>Q10 Is it reasonable to assume that the 'alias' of the detached cursor remains what it was as specified in the CursorAdapter 'Alias'?

Yes.

>
>BeforeCursorDetach Event
>Under the "Remarks", only line, it says "If the code in BeforeCursorDetach returns a value of False (.F.), the cursor does not detach, and any return values are ignored.".
>Q11 What is being referred to by "...any return values..."?
Simon White
dCipher Computing
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform