Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoid repeated values with more than two users
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Avoid repeated values with more than two users
Miscellaneous
Thread ID:
01322172
Message ID:
01322172
Views:
60
I want to make sure code generation is not repeating codes when using two instaces of the same form

ped_test.dbf is buffered as 5

Then I runned form 1 and form 2 at the same time with
2 differents instaces of VFP, as below:


***********************form 1 code**************************
SELECT PED_TEST
DO WHILE PED_TEST.COD < 100000


dimension lctemp[1]
select max(PED_TEST.cod) from PED_TEST ;
into array lctemp
lcTemp[1] = nvl(lcTemp[1],0)+1

APPEND BLANK

replace PED_TEST.COD with lctemp
replace ped_test.id WITH "FORM 1"
= TABLEUPDATE ()
LOOP
ENDDO


***********************form 2 code**************************


SELECT PED_TEST
DO WHILE PED_TEST.COD < 100000


dimension lctemp[1]
select max(PED_TEST.cod) from PED_TEST ;
into array lctemp
lcTemp[1] = nvl(lcTemp[1],0)+1

APPEND BLANK

replace PED_TEST.COD with lctemp
replace ped_test.id WITH "FORM 2"
= TABLEUPDATE ()
LOOP
ENDDO
**********************************************

At the end of the test I have repeated values
if I browse my two fields table I have something as:

------------------------
cod ---ID
------------------------

1000 - FORM 1
1000 - FORM 2
1001 - FORM 1
1001 - FORM 2
1002 - FORM 1
1002 - FORM 2 , ETC


I would like something as:


1000 - FORM 1
1001 - FORM 2
1002 - FORM 1
1003 - FORM 2
1004 - FORM 1
1005 - FORM 2 , ETC

Can anybody imagine a better code to run my tests ?
Next
Reply
Map
View

Click here to load this message in the networking platform