Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PrimaryKey() in Free Tables
Message
 
 
À
23/05/2002 11:33:26
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Divers
Thread ID:
00660057
Message ID:
00660545
Vues:
14
>>The other think you could do is before you use the primarykey function on a free table is consider the tag/key you are going to use. Look at the highest value in the table. Go into the registry manager and create a counter manually and set its value to the highest key value that exists in the table. Then in your code, use primarykey() and specify the name of the counter you manually created as the primarykey counter name argument. The primarykey will simply start from the counter's current value.<<

OK, this is something similar to what I have done since I posted the prior message. I created a custom function called IncreKey() which was created by modifying the PrimaryKey() function. If a Primary index field isn't found in a free table (which it never is), it will use the cField parameter of PrimaryKey() as the controlling index to generate the increment for. After calling this once, I can just use the PrimaryKey() function as normal.

Thanks for your help, I was just making sure I wasn't missing something within CodeMine that already did this.

Mel Cummings
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform