>>>>>TABLEUPDATE() :-)))))
>>>>>
>>>>>Like its sang in "Porgy and Bess" "It's summer time and the livin' is easy ...."
>>>>
>>>>Yes, thanks figured this out. I was doing .NET recently and thus somehow expected CA to have a method to pass my changes, something like AcceptChanges()
>>>
>>>You could make your own :-) in your CA base class.
>>
>>Just wondering... if VFP knows that a CA has an attached alias, and coordinates tableupdate() with the CA... what if there are two CA objects attached to the same alias? Would this produce an error, or would Fox get confused or...? Is there any knowledge about this issue lying around?
>
>Yes, the error "Alias already in use" will raise :-)
Not two CA's creating the same cursor - the second would close the first one's. More like this:
LOCAL ca1 as CursorAdapter, ca2 as CursorAdapter
CREATE CURSOR crs1 (l l)
ca1=CREATEOBJECT("ca")
ca2=CREATEOBJECT("ca")
ca1.CursorAttach("crs1")
ca2.CursorAttach("crs1")
INSERT INTO crs1 VALUES (.f.)
?TABLEUPDATE(1,.f.,"crs1", a)
DEFINE CLASS ca as CursorAdapter
PROCEDURE AfterInsert
?this.Name, PROGRAM()
ENDDEFINE
The second one simply doesn't attach. Its alias remains empty. Seems that Fox maintains a pointer to the CA somewhere in the alias, and if it already has an adapter in the current DS, it won't attach another - but won't cause an error either.
And the AfterInsert() doesn't fire at all... which I didn't expect.