General information
Category:
Forms & Form designer
>What do you mean by "makes a call to another object
>to change the datasession"? Can you provide code
>that shows what you mean here?
Certainly. Assume I have a form (form1) with a grid on it and button. The form is called from the code snippet below
DO FORM form1
READ EVENTS
DEFINE CLASS custtest AS custom
FUNCTION DOSTUFF
SET DATASESSION TO 1
WAIT WINDOW "Custom object: Data session: " + ;
LTRIM(STR(SET('DATASESSION'))) TIMEOUT 1
SET DATASESSION TO 2
ENDFUNC
ENDDEFINE
The button click event has the following code in it.
LOCAL lnDataSession
WAIT WINDOW "FORM Data session: " + ;
LTRIM(STR(SET('DATASESSION'))) TIMEOUT 1
lnDataSession = SET('DATASESSION')
ocusttest = CREATEOBJECT("custtest")
ocusttest.dostuff()
SET DATASESSION TO lnDataSession
WAIT WINDOW "FORM Data session: " + ;
LTRIM(STR(SET('DATASESSION'))) TIMEOUT 1
If the code in the dostuff() method of the custom object is placed unchanged into the click event of the button the grid loses its data but because the code is contained within the custom object the grid works perfectly.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only