Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reccount()
Message
De
27/01/2010 09:17:38
 
 
À
27/01/2010 08:52:37
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01445855
Message ID:
01446146
Vues:
26
>>
>>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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform