Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does this datasession exist?
Message
From
28/08/2003 07:45:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00824110
Message ID:
00824125
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Hi All,
>
>Does anyone know of a way to find out whether a certain Datasession number is currently in use? The function AUSED( laUsed, 10 ) will generate an error if that number (10) is still not in use.

Peter,
VFP7 and later has asessions() to get available sessions.
Prior to VFP7 only VFP6 has session object (if I remember right), others could only have private sessions through forms. You could access and loop session and form objects with _vfp.objects and get datasessionIDs into an array. ie:
local array laSessions[1], laUsed[1]
local ix
laSessions=1 && Default
for ix=1 to GetSessions(@laSessions)
 ? aused(laUsed,laSessions[ix])
endfor

function GetSessions
lparameters taSessions
local ix
for ix=1 to _vfp.objects.count
  with _vfp.objects(ix)
    if type('.Datasession') = 'N' and .Datasession = 2
	dimension taSessions[alen(taSessions)+1]
	taSessions[alen(taSessions)] = .DataSessionID
    endif
  endwith
endfor
return alen(taSessions)
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform