Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Seek inconsistency
Message
 
À
13/02/2010 06:00:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01449027
Message ID:
01449045
Vues:
52
Hi Gregory. Thanks for yoyur reply
I know that I can work around it , but I would like to know why its happening.
I cannot see any reason for it.
Also the fact that it is inconsistent.....
If I run the exactly the same code 10 times I get 10 completely different results
Surely this must be some sort of Foxpro Bug ??
Regards,
Gerard








>>I have seen the following problem inconsistently at our sites over the past few years but have now
>> been able to replicate it, but I dont understand why it is happening.
>>
>>Scenario as follows:
>>I have a grid and a command button on a page
>>The Grid shows mostlty records from a Transaction file (TRAN)
>>One of the rows in the grid is: Iif(seek(Cusac,'CUSMF','CUSTAG'),CUSMF.CusName,' ')
>> (This just shows a Customer Name on a Grid using a lookup to a Customer Master File)
>>
>>On the button click event , I have something like:
>>Sele Tran
>>Scan
>> ....
>> && AAAA
>> Seek Tran.Cusac
>> If not eof()
>> Do stuff on the CUSMF
>> Endif
>> Sele Tran
>>Endscan
>>
>>Now most times, this works fine.
>>When there are lots of Transation records, say 100 or more, the wrong CUSMF record is seeked (In AAAA)
>>If there are say 900 records, the wrong CUSMF record could be processed wrongly 4 times
>>If I run the same code again, wrong records are processed, but different wrong records
>>
>>The 'ACTUAL' record that is incorrectly 'Seeked' turns out to be the Last record that is visible on the Grid
>>This is always the case.
>>What appears to be happening, randomly, is that in the middle of the Scan Loop (which is on the Click event of a Button)
>> Foxpro is going back to the screen somwhow, running the IIF on the grid, landing on a different record and then processing
>> thsi record on the CUSMF instead of the SEEKED record. I think the SEEK is actually working but in the middle of the loop
>> the IIF is also kicking in and landing on the wrong record.
>>
>>As far as I can tell, I dont have any code that refreshes, or sets focus back to the form, I dont have any set realtions on either
>>
>>Now that I have been able to replicate this, it expalins about 4 other intances in Forms where data has been updating the wrong account, on other tables
>>
>>I have been able to code around it by either making the Grid Invisible (just prior to calling the code) or taking the IIF out of the Grid
>>
>>Would anybody have an explanation for this type of behaviour ?
>>TIA,
>>Gerard
>
>Gerard,
>
>Some possibilities
>
>(1) Try to put the focus on something other than the grid during processing
>(2) reUSE the table with some other alias, and work on the other alias
>(3) (best) use a view with an outer join as the recordsource of the grid - to avoid the iif()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform