Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing form
Message
De
29/10/2004 04:58:52
 
 
À
24/10/2004 08:10:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 5
Divers
Thread ID:
00954064
Message ID:
00955706
Vues:
16
hi,

i try to put this function under at my form
i get error message (method and events cannot contain nested procedure or class definition)

as
1.i create new method (GetNextBillNo)
2.i put at this method the function as..
i have two tables one is mstr have all bills,another temp i use it as temporery table at my form.
Function GetNextBillNo
local lcAlias, lnReprocess, lnBillNo
lcAlias=select() && remeber alias  can i replace my (temp.table) with &&&lcAlias=select(temp) 
lnReprocess=SET('REPROCESS()') && remember value
SET REPROCESS TO 1 && Retry evey one second
SELECT 0 && find an available work area
USE mstr order BillNo again && BillNo is an index tag on BillNo
DO WHILE .T.
   GO BOTTOM && this record holds the highest number
   lnBillNo=mstr.BillNo
   APPEND BLANK
   IF !RLOCK() && Someone else is doing exactly the same, so he comes first
      WAIT 'Someone else is billing, you must wait!' WINDOW NOWAIT
      LOOP && wait a second and try again
   ENDIF
   REPLACE Billno with lnBillno + 1
   lnBillNo=mstr.BillNo && lnBillNo is the next bill number
   EXIT
ENDDO
USE && Close
WAIT CLEAR && In case any Wait window is open
SET REPROCESS TO lnReprocess && always restore
SELECT (lcAlias) && always restore
RETURN lnBillNo
best regards
m.qasem
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform