Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Many Data Sessions?
Message
From
03/03/1999 18:20:06
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00192961
Message ID:
00193825
Views:
16
>>Here's a method I use to determine the highest datasession number--the algorithm looks something like this:
>>
>>FOR i = 1 TO
>> SET DATASESSION TO &i
>> check if an error occurred
>> if no error occurred
>> i is now the highest known datasession
>> endif
>>ENDFOR
>>
>>If you want to know how many datasessions exist rather than the highest number, just change the logic to count rather than find the high datasession id.
>>
>>The art here is guessing how high to set so you don't miss any datasessions balanced against the time it takes to check each one (you don't want to check all 32K of the possibilities). I just pick some reasonable number, but you could also develop more sophisticated logic, such as: keep checking datasessions until you find 10 (or whatever) sequential unused datasessions.
>
>I don't know any other way but to have some sort of form mgr class or setup that has an array of form objects stored. You can roll thru the array finding the max datasession for the forms.
>
>Steve

See the code I posted. It will find the exact number of datasessions in any situation.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform