Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Switching DataSession's
Message
De
13/12/2004 13:35:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/12/2004 13:22:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00968641
Message ID:
00968841
Vues:
7
Gunnar,
I just tested under VFP-Sp5 switching.
Public loProc, loForm1,loForm2
loProc = createobject('myProcs')
loForm1 = createobject('myForm')
loForm2 = createobject('myForm')
loForm2.Top = loForm1.Top + 200
loForm2.Left = loForm1.Left + 200
loForm1.Show()
loForm2.Show()
On key label 'F2' loProc.ShowSession()
loProc.ShowSession()


Define class myProcs as custom
    Procedure ShowSession
    If Type("_screen.ActiveForm") = "O" and !isnull(_screen.ActiveForm)
        If _screen.ActiveForm.Datasession = 2 && Private
			_screen.cls
            Set datasession to _screen.DataSessionID
            _Screen.Print('Screen: '+trans(set("DataSession"))+chr(13))
            Set DataSession to _screen.ActiveForm.DatasessionId
            _Screen.Print('ActiveForm: '+trans(set("DataSession"))+chr(13))
            Set DataSession to
            _Screen.Print('Current: '+trans(set("DataSession"))+chr(13))
        Endif
    Endif
Endproc
Enddefine

Define class myForm as form
    DataSession = 2
    Top = 200
    Left = 200
Enddefine
Cetin

>Cetin, all 3 show ds id 1. so it's not switching at all
>
>
>>Gunnar,
>>I didn't expect it to change the data session. It's already in that session. Only wanted to note &CommandDS was wrong. You could test this way:
>>
>>
if Type("_screen.ActiveForm") = "O" and !isnull(_screen.ActiveForm)
>> if _screen.ActiveForm.Datasession = 2 && Private
>>    set datasession to _screen.DataSessionID
>>    _screen.Print('Screen'+trans(set("DataSession"))+chr(13))
>>    set DataSession to _screen.ActiveForm.DatasessionId
>>    _screen.Print('ActiveForm'+trans(set("DataSession"))+chr(13))
>>    set DataSession to
>>    _screen.Print('Current'+trans(set("DataSession"))+chr(13))
>> endif
>>endif
>>Cetin
>>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform