Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird result of the scan
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Weird result of the scan
Divers
Thread ID:
00684159
Message ID:
00684159
Vues:
39
Hi everybody,

I have very strange result of the following method:
********************************************************************
*  Description.......: RunCommand - executes passed commands
*  Calling Samples...:
*  Parameter List....: tcCommand, tcNullCommand, tcFor
*  Created by........: Nadya Nosonovsky 07/30/2002 03:28:32 PM
*  Modified by.......:
********************************************************************
lparameter tcCommand, tcNullCommand, tcFor
local lnSize, lcType, lnChanged, lnSelect, lcCreate

with thisform
	lcType = .cFieldType
	lnSize = .nFieldSize
	lnSelect = select()
	use in select('curPreview')
	select 0
	lcCreate=[create cursor curPreview (OldFldVal ]+ ;
         m.lcType+' ('+ transform(m.lnSize)+ ;
         '), NewFldVal '+ m.lcType+' ('+ transform(m.lnSize)+'))'
	&lcCreate  && Create cursor curPreview

	lnChanged = 0
	select (.cProcessTable)

	scan &tcFor
	
		if m.plStop
			exit
		endif

		if .CommandFail
			exit
		endif

		OldFldVal = evaluate(.cProcessTable+"."+.TargetFld)
			
		&tcCommand
		
		lnChanged = m.lnChanged +1
		
		if .ConvNull and not .CommandFail
			&tcNullCommand && If new field empty - replace with a null
		endif  &&End of 2/7/02 change
		
		NewFldVal = evaluate(.cProcessTable+"."+.TargetFld)
		
		insert into curPreview from memvar
	endscan
endwith

select curPreview
go top
browse
use && Close
select (m.lnSelect)

return m.lnChanged
I have 10 records in the file. I execute this method for ALL records (tcFor = 'ALL'). My cursor curPreview shows only 1 record with incorrect values. The message is saying, that only 1 record was changed. Yet I see, that all 10 records were changed correctly. Could you please tell me, what's wrong?

I had similar strange result without scan command (executing replace command)

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform