Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Descending/Ascending not respecting Datasession
Message
 
To
09/09/2001 13:15:21
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00554138
Message ID:
00554746
Views:
12
Hi Eric

I posted some sample code below:


In the command window I executed the following commands to create two forms with private datasessions and then I check the index order and it is in ascending order as expected.

Then I change the order to Descending in form2 and check the order in both forms again. They both now show descending order. If I browse the table they both are in descending order.
Set Proc to test.prg
loFrm1=CreateObject("frmStd")
loFrm2=CreateObject("frmStd")
? lofrm1.GetOrder()
? lofrm2.GetOrder()

Ascending
Ascending


loFrm2.SetOrder("D")
? lofrm1.GetOrder()
? lofrm2.GetOrder()

Descending
Descending
Private Datasession Form Class
* Test.Prg --- Testing Private datasessions
Define Class frmStd As Form
   DataSession=2
   
   Procedure Init
      Select 0
      USE APMaster Order Tag AcctNo Ascending
   EndProc
   Procedure SetOrder
      LParameters lcOrd
      Select APMaster
      If lcOrd="A"
         Set Order To Tag AcctNo Ascending
      Else
         Set Order To Tag AcctNo Descending
      EndIf
   EndProc
   Procedure GetOrder
      Select APMaster
      Return Iif(Descending(),"Descending","Ascending")
   EndProc
EndDefine
>>Hi
>>
>>
>>Datasession 2
>>
>>Use APMaster
>>Set Order to Tag Acctno Descending
>>
>>
>>DataSession 3
>>
>>Use APMaster
>>Set Order To tag AcctNo Ascending
>>
>>
>>
>>The code in datasession 3 changes the order in datasession 2 to ascending. I thought that private datasessions prevented this kind of interaction between files.
>>
>>Is this a bug or is this the way it should work? I have a new application that uses private datasessions so that changes in one form do not affect another form and this type of interaction will cause problems for me.
>>
>>Simon White
>
>This is not the way it should work. Can you post some repro code?
Simon White
dCipher Computing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform