Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The Mother of Unique IDs
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00009899
Message ID:
00009911
Vues:
43
>Here is the complete code:
>
>function kUniqueID
>*-
>lparameters tcTable,tcTag
>*-
>if empty(tcTable) or empty(tcTag)
> *-
> return(int(seconds() *100000 + day(date())))
>endif
>lcTable = tcTable
>lcTag = tcTag
>*-
>if eof(lcTable)
> lnRecNo = 0
>else
> lnRecNo = recno(lcTable)
>endif
>*-
>do while TRUE
> lnID = int(seconds() *100000 + day(date()))
> go top
> if seek(lnID,lcTable,lcTag)
> loop
> else
> exit
> endif
>enddo
>*-
>if !empty(lnRecNo)
> go (lnRecNo) in (lcTable)
>endif
>*-
>return(lnID)
>
>HTH,
>Tom

You don't need GO TOP before SEEK(). :)

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform