Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INDEXSEEK in field default code
Message
De
10/06/2004 14:04:20
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
INDEXSEEK in field default code
Divers
Thread ID:
00912351
Message ID:
00912351
Vues:
63
Hi All,

Consider a buffered table with two integer key fields (say 'id' and 'uid') both with default triggers in the DBC:
PROCEDURE SetID
LOCAL lntheKey
lntheKey = 0
DO WHILE .T.
  theKey = theKey+1
  IF INDEXSEEK(lntheKey,.F.,"theTable","id")
    LOOP
  ENDIF
  EXIT
ENDDO
RETURN lntheKey

PROCEDURE SetUID
LOCAL lntheKey
lntheKey = 0
DO WHILE .T.
  lntheKey = lntheKey+1
  IF INDEXSEEK(lntheKey,.F.,"theTable","uid")
    LOOP
  ENDIF
  EXIT
ENDDO
RETURN lntheKey
SetId() gets called first and, on entry into SetUID(), theTable.id field is populated as expected.
However when the INDEXSEEK() in SetUid() executes the id field reverts to 0. Any ideas on how to prevent this ?

TIA,
Viv
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform