Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reccount()
Message
From
27/01/2010 09:17:38
 
 
To
27/01/2010 08:52:37
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01445855
Message ID:
01446146
Views:
25
>>
>>i thought it over came up with
>>
>>SELECT v_lclients
>>GO TOP 
>>
>>
>>FOR i = 1 TO numpep
>>
>>	DO CASE
>>		
>>		CASE i=1
>>			Thisform.pageframe1.page5.combo2.value = clientid
>>			
>>		SKIP 
>>            
>>		CASE i=2
>>			Thisform.pageframe1.page5.combo4.value = clientid
>>			
>>		SKIP 
>>            
>>		CASE i=3
>>			Thisform.pageframe1.page5.combo5.value = clientid
>>		SKIP 
>>		
>>		CASE i=4
>>			Thisform.pageframe1.page5.combo6.value = clientid
>>		
>>		SKIP 
>>		
>>		CASE i=5
>>			Thisform.pageframe1.page5.combo7.value = clientid
>>		
>>		SKIP 
>>		
>>	ENDCASE
>>ENDFOR 
>>
>
>Relying on particular order of records in a table is unstable - but let's assume you have code elsewhere that guarantees that the five clientIDs will be where you need them. Try this:
>
SELECT v_lclients
>SCAN NEXT numpep
>	DO CASE
>		CASE recno()=1
>			Thisform.pageframe1.page5.combo2.value = clientid
>            
>		CASE recno()=2
>			Thisform.pageframe1.page5.combo4.value = clientid
>            
>		CASE recno()=3
>			Thisform.pageframe1.page5.combo5.value = clientid
>		
>		CASE recno()=4
>			Thisform.pageframe1.page5.combo6.value = clientid
>		
>		CASE recno()=5
>			Thisform.pageframe1.page5.combo7.value = clientid
>		
>	ENDCASE
>ENDSCAN
>
>Even with the for-next loop, you didn't need all the skip commands. You could have a "GO i" before the CASE, to the same effect - each iteration of the loop, you'd be on record i.

bu-bu-but didnt i need the skip to jump to the next record?(which i suspect thats what scan does)
Where does your I increment? the Next?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform