Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FPW 2.6 inserting/adding new records...
Message
De
11/05/2000 22:23:22
 
 
À
11/05/2000 11:46:40
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00368607
Message ID:
00368929
Vues:
17
Chuck,

>SET ORDER TO offset
>REINDEX
>GO BOTTOM
>endrec = RECNO()
>GO TOP
>DO WHILE
>This is what I came up with... I need to create one cash offset record for each (as also in index 'offset'). The cash
>offset record must follow immediately after the group of transactions ('offset').

Is "offset" a standalone IDX-style index, or is it a tag in a structural CDX index? If it's a tag, you don't need the REINDEX, because the index is always maintained automatically.

It sounds like what you need is to just insert the offset record into the table for each field combination that needs it, with some way of making it fall immediately after the other records.

One way to do it would be an extra character field that is blank for all records, but contains "Z" for the offset records. The offset record of course will contain the same values in the "field combination" that match it. Then make your index expression the field combination + the extra field.

For example:
field1 field2 field3 extrafield
ABC    DEF    125.00  (blank)
ABC    DEF     75.00  (blank)
ABC    DEF    200.00  Z       <--this is the offset record
* next line is only done once, 
* and is automatically maintained after that.
INDEX ON field1 + field2 + extrafield TAG offset
I don't know what goes into a real offset record, but maybe you get the idea. No matter where the offset record above is physically inserted into the table, it will always follow the other two when you SET ORDER TO TAG offset.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform