Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No. of people using a DBF
Message
De
31/03/2005 10:58:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Versions des environnements
Visual FoxPro:
FoxPro Dos
Divers
Thread ID:
00999886
Message ID:
01000346
Vues:
43
Can you post the code for intrandrange()


>Hi Craig
>
>I have tried something like the following but have a problem is that at times the 2nd-3rd user is allowed to FCREATE() the file already assigned to the prev user ie. 1st-2nd resp. How to avoid allowing to use the same filename. I have tried it on the same machine seperate DOS boxes.
>
>Please advise.
>
>
        *** seed and ignore the first returned value
>        m.zfilename = intrandrange(00000000, 99999999, 87654321)
>
>
>        FOR m.zusercount = 1 TO m._vsomaxuser
>                *** get an integer for use as a filename
>                m.zfilename = ALLTRIM(STR(intrandrange(00000000, 99999999))) + ".acu"
>                m.zfh       = FCREATE(m.zfilename)
>wait window "1" + str(m.zusercount) + " " + m.zfilename + str(m.zfh)
>
>                IF m.zfh > -1
>                        *** Person is no longer using the application and did not
>                        *** log out properly, now that we have the open handle keep it
>                        *** open and exit
>                        EXIT
>                ENDIF
>        ENDFOR
>
>
>wait window "2" + str(m.zusercount) + " " + m.zfilename + str(m.zfh)
>        IF (!m.nomore) AND (m._vsolan AND m.zusercount > m._vsomaxuser AND m._vsomaxusers > 0)
>                * WARNING !!! Maximum
>                * users Allowed; Close Idle Instances of this Applcation before
>                * ReStarting; If a Node was Hanged or ReBooted Please ReStart ALL
>                * Instances again
>
>                m.nomore = .T.
>        ENDIF
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform