Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Do While... Continue Command!!!
Message
 
 
To
13/02/2003 20:35:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00753026
Message ID:
00753033
Views:
15
Virgilio,

You can use query to get the same result in more clear way and with less coding.
SELECT * ;
	FROM print_cost ;
	WHERE print_cost.buwan = ALLTRIM(Thisform.combo1.value) ;
	INTO CURSOR crsList
SELECT print_pera	
APPEND FROM (DBF("crsList"))
USE IN crsList
In VFP8 you can do this with one command INSERT INTO SELECT FROM

BTW, If you cannot use query for some reason, SCAN ENDSCAN is more appropriate for such kind of processing. Also, there is no reason to use separate replace for each field. One replace for all fields would be more readable and faster.


>HEy Guys can you help me with this..
>
>I have a code that suppose to locate for everything that matches the value of a combo box. I used the Do while..Continue command, but it only finds 3 records out of four records or four out of five records and so on.... It usually did not find the first match record. My syntax is this...
>SELECT PRINT_COST && table to be search
>
>LOCATE FOR ALLT(THISFORM.COMBO1.VALUE)=ALLT(PRINT_COST.BUWAN)
>DO WHiLE !EOF() && begins my loop
>
>** If found a match it should append the other table with the values of    ** other table
>
>	CONTINUE
>	IF FOUND() THEN
>		SELECT PRINT_PERA
>		APPEND BLANK
>		REPLACE PRINT_PERA.BUWAN WITH PRINT_COST.BUWAN
>		REPLACE PRINT_PERA.ITEM WITH PRINT_COST.ITEM
>		REPLACE PRINT_PERA.ADM WITH PRINT_COST.ADM
>		REPLACE PRINT_PERA.ACC WITH PRINT_COST.ACC
>		REPLACE PRINT_PERA.SCS WITH PRINT_COST.SCS
>		REPLACE PRINT_PERA.SSD WITH PRINT_COST.SSD
>		REPLaCE PRINT_PERA.FDD WITH PRINT_COST.FDD
>		
>		
>	SELECT PRINT_COST
>	ENDIF
>ENDDO	
>
>PLease correct my Codings....
>
>Thanks and God Bless!!
>
>V_E_R
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform