Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scatter
Message
 
À
28/10/1997 06:03:43
Chiang Jeffrey
Paramoun Air Sea Svcs P/L
Singapore, Singapour
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00040596
Message ID:
00056953
Vues:
48
Chiang,

Change your cod to this;

** This code is in the click event of the NEW button.
** the invsetup lookup table is also in the data environment of the form.

*******
LOCAL lcAlias
lcAlias = ALIAS()

SELECT InvSetup
meminv=0
meminvnext=0
&& Get next Invoice/do number

DO WHILE NOT RLOCK()
ENDDO
meminv=invsetup.nextinv
replace nextinv with nextInv + 1
UNLOCK
IF NOT EMPTY(lcAlias)
SELECT ( lcAlias )
ENDIF
RETURN meminv

******


Two things have been added, 1) the selected alias is proitected and 2) the invoice number table is locked before the next inv number is played with. The first insure that the calling environment is restored on teh way out of the routine and the second insures that there will never be duplication invoice numbers generated by this code.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform