Hi all,
I have a problem with session class and I dont know if i'm wrong or it is a vfp bug.
When I add a session control to a container with .AddObject() the session control dont create a own datasession. Instead if I create it with CreateObject() it creates a own datasession.
I use vfp 7 sp1
I dont know if is the same with vfp8.
I create a little sample:
create a table with some field and name it "tabella"
Then create a program with this code:
***
ON SHUTDOWN quit
oFormTest=CREATEOBJECT("formtest")
READ events
DEFINE CLASS formtest as form
PROCEDURE init
* oTest1=createobject("test1")
* oTest2=createobject("test2")
This.Addobject("oTest1","test1")
This.Addobject("oTest2","test2")
RETURN
ENDDEFINE
DEFINE CLASS test1 as session
PROCEDURE init
USE tabella
IF USED("tabella")
MESSAGEBOX("USED(TABELLA)")
ELSE
MESSAGEBOX("NOT USED(TABELLA)")
ENDIF
RETURN
ENDDEFINE
DEFINE CLASS test2 as session
PROCEDURE init
IF USED("tabella")
MESSAGEBOX("USED(TABELLA)")
ELSE
MESSAGEBOX("NOT USED(TABELLA)")
ENDIF
RETURN
ENDDEFINE
***
Can someone check for it?
Thank you
Andrea C.P.
Italy Turin
I have a problem with session class and I dont know if i'm wrong or it is a vfp bug.
When I add a session control to a container with .AddObject() the session control dont create a own datasession. Instead if I create it with CreateObject() it creates a own datasession.
I use vfp 7 sp1
I dont know if is the same with vfp8.
I create a little sample:
create a table with some field and name it "tabella"
Then create a program with this code:
***
ON SHUTDOWN quit
oFormTest=CREATEOBJECT("formtest")
READ events
DEFINE CLASS formtest as form
PROCEDURE init
* oTest1=createobject("test1")
* oTest2=createobject("test2")
This.Addobject("oTest1","test1")
This.Addobject("oTest2","test2")
RETURN
ENDDEFINE
DEFINE CLASS test1 as session
PROCEDURE init
USE tabella
IF USED("tabella")
MESSAGEBOX("USED(TABELLA)")
ELSE
MESSAGEBOX("NOT USED(TABELLA)")
ENDIF
RETURN
ENDDEFINE
DEFINE CLASS test2 as session
PROCEDURE init
IF USED("tabella")
MESSAGEBOX("USED(TABELLA)")
ELSE
MESSAGEBOX("NOT USED(TABELLA)")
ENDIF
RETURN
ENDDEFINE
***
Can someone check for it?
Thank you
Andrea C.P.
Italy Turin