Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keeping an array sorted
Message
From
30/10/2000 13:54:19
 
 
To
26/10/2000 15:37:43
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00434680
Message ID:
00435983
Views:
42
I'm going to have to totally re-write it anyway because of other issues. I'll take a look at this when I get back to it.

Thanks,

Michelle



>You're right, in this case sorting won't obviously help you. However, a cursor still might make your life easier:
LOCAL ;
>	lnLowestValue, ;
>	lnLowestRow, ;
>	lnNewValue
>
>* Initialize the cursor:
>CREATE CURSOR iTest ;
>	(iValue I)
>
>FOR lnIx = 1 TO 6 STEP 1
>	INSERT INTO iTest ;
>		(iValue) ;
>		VALUES ;
>			(lnIx)
>
>ENDFOR
>
>* Change the values:
>lnLowestValue = 1
>lnLowestRow = 3
>
>REPLACE ALL ;
>	iTest.iValue WITH IIF(RECNO("iTest") < lnLowestRow, ;
>		RECNO("iTest") + (RECCOUNT("iTest") - lnLowestRow) + lnLowestValue, ;
>		lnLowestValue + (RECNO("iTest") - lnLowestRow)) ;
>	IN iTest
Previous
Reply
Map
View

Click here to load this message in the networking platform