Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this SCAN ...ENDSCAN correct?
Message
De
08/02/2004 15:08:59
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00871624
Message ID:
00875279
Vues:
14
Thank you Sylvain. Appreciate your input.

>Hi Henry,
>
>Sergey's solution of one UPDATE command is really the way to look for, but what was probably causing you problems was the INSERT INTO command inside the SCAN/ENDSCAN would move the record pointer to the last record according to the current order set, which would prevent some records from being scanned.
>
>
>>Hi all:
>>
>>The following code is not accomplishing what I wanted it to.
>>
>>
&& Pull data from ClientList.dbf into a cursor
>>SELECT * from ClientList INTO cursor curClientList nofilter
>>GO top
>>
>>&& Set the value of this variable
>>mLastUpdate = curClientList.CurUpdate
>>
>>&&Update the fields for each record in the table
>>mCurUpdate = DATE()
>>
>>select ClientList
>>
>>SCAN
>>	IF mLastUpdate = {}
>>		mLastUpdate = DATE()
>>		INSERT INTO ClientList (LastUpdate);
>>   			VALUES (mLastUpdate)
>>   	ENDIF
>>ENDSCAN
>>
>>select ClientList
>>
>>SCAN
>>   	IF curClientList.CurUpdate = {}
>>   		INSERT INTO ClientList (CurUpdate);
>>   			VALUES (mCurUpdate)
>>   	ELSE
>>   		UPDATE ClientList
>>   			SET ClientList.LastUpdate = mLastUpdate;
>>   				ClientList.CurUpdate = mCurUpdate
>>   ENDIF
>>ENDSCAN
>>
>>This code appears to be starting from empty records. Where am I going wrong? Thank you for your assistance.
- Ravi

True greatness consists in being great in little things.
- Charles Simmons
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform