Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deteremine how many datasessios are open
Message
De
08/06/1999 11:21:15
Mark Hall
Independent Developer & Voip Specialist
Keston, Kent, Royaume Uni
 
 
À
08/06/1999 02:40:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00227341
Message ID:
00227456
Vues:
21
>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
Regards
Mark

Microsoft VFP MCP
Menulib - OO Menus for VFP www.hidb.com/menulib
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform