Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Maintaining data session state
Message
 
 
À
21/09/2002 18:45:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00703118
Message ID:
00703120
Vues:
15
Object methods are always executed in the datasession object was created under.

>Given the following code:
>
>
>loTest=CREATEOBJECT('Test')
>MESSAGEBOX('Data session after having created Test: '+STR(SET('DATASESSION')))
>
>loPrivateData=CREATEOBJECT('PrivateData')
>SET DATASESSION TO loPrivateData.DataSessionID
>MESSAGEBOX('Data session now switched to 2: '+STR(SET('DATASESSION')))
>
>loTest.Go()
>
>DEFINE CLASS Test AS Custom
>FUNCTION GO
>MESSAGEBOX('Data session inside method is switched back to 1: '+STR(SET('DATASESSION')))
>ENDFUNC
>ENDDEFINE
>
>DEFINE CLASS PrivateData AS Session
>ENDDEFINE
>
>
>Can someone explain me why calling a method from the Test object resets the data session to 1? We are sitting on data session 2 when calling that method. Why it is resetting itself to 1?
>
>I need to maintain the data session state. How can I make that work?
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform