Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug? in grid control & multiple data sessions: data vani
Message
De
14/01/2003 18:01:41
Paul Dorrington
Dorrodata Computing Pty Ltd
Carlton, Australie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00741303
Message ID:
00741673
Vues:
21
>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
Fil
Voir

Click here to load this message in the networking platform