Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Avoid repeated values with more than two users
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Avoid repeated values with more than two users
Divers
Thread ID:
01322172
Message ID:
01322172
Vues:
61
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 ?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform