Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INDEXSEEK in field default code
Message
From
10/06/2004 14:04:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
INDEXSEEK in field default code
Miscellaneous
Thread ID:
00912351
Message ID:
00912351
Views:
62
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
Next
Reply
Map
View

Click here to load this message in the networking platform