Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this SCAN ...ENDSCAN correct?
Message
 
To
28/01/2004 19:56:29
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00871624
Message ID:
00871876
Views:
14
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform