Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this SCAN ...ENDSCAN correct?
Message
 
À
28/01/2004 19:56:29
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:
00871876
Vues:
15
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform