Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why can't I change DataSession in a class
Message
De
07/06/2002 15:31:18
Irv Adams
MSC Managed Care, Inc.
Floride, États-Unis
 
 
À
07/06/2002 14:54:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00666133
Message ID:
00666145
Vues:
16
As far as I can tell, everything you want to do regarding Tables, Datasessions, etc. must be done within the scope of the Session code itself. The 'Set Datasession' issued within the Method overrides the Session class created. The Session is 'beneath' the Method in calling order.

You need to 'wrap' something with a Session Class, meaning let all the work be done within the Session or it will go out of Scope...or, Add the Session to a Container as an object and all items within that container can access it...

-Irv.

>I tried this:
>SomeForm.Method()
>  local lo
>  lo = NewObject('Save_Ds','Save_Ds.prg')
>  Set DataSession to SomeOtherDataSession
>  .... print a report from SomeOtherDataSession
>  release lo
>  .... continue some more in Form.DataSession
>
>Save_DS.prg
>  Define Class Save_Ds as Custom
>    nDS = Set('DataSession')
>    Procedure Destroy()
>      Set DataSession to this.nDs
>    EndProc
>  EndDefine
>
Why doesn't it work?
>In the debugger. As soon as the Save_Ds.Destroy() method starts, the DataSession changes from SomeOtherDataSession to the one I want (making the line "Set DataSession to this.nDs" pointless), but as soon as it goes back to SomeForm.Method() the DataSession changes back to SomeOtherDataSessoin.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform