Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement