Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deteremine how many datasessios are open
Message
 
À
08/06/1999 11:21:15
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00227341
Message ID:
00227460
Vues:
22
Data sessions are bound with the forms. If you close all open forms, all data sessions will get released.

>>People ,
>>
>>Do you have a function where i can determine how many datasessions
>>are open
>>
>>Regards ,
>>david
>
>I've needed this in an application cleanup. If it crashes, close up all the outstanding datasessions before exitting VFP.
>
>The only way that I found to do it was to try SET DATASESSION TO for each session, then catching an error if it ocurred.
>
>Something like
>
>FUNCTION SessionCount
>LOCAL lcOldError, lnLoop, lnCount
>PUBLIC glFlag
>
>lcOldError = ON("ERROR")
>lnCount = 0
>ON ERROR glFlag = .t.
>
>FOR lnLoop = 1 TO 1000
> glFlag = .f.
> SET DATASESSION TO (lnLoop)
> IF NOT glFlag
> lnCount = lnCount + 1
> ENDIF
>ENDFOR
>
>ON ERROR &lcOldError
>RELEASE glFlag
>
>RETURN lnCount
- Jayesh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform