Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program is running slow - need advice for optimizing
Message
From
08/07/2004 03:08:23
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
08/07/2004 02:54:19
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00921850
Message ID:
00921855
Views:
20
Hi
For a better code read/copy , enclose code blocks in < PRE > < /PRE > tags (without spaces)
Code can be optimized, opening the target table in loop can slow things down:
select 1
USE ss
SCAN
    INSERT INTO ALL (name, p_o_box, postalcod, degree) ;
    VALUES ;
    (ss.name, ss.p_o_box, ss.postalcod, ss.degree)
ENDSCAN
>hi all,
>
>i write this code at my program,
>
>it works ,it's seems slowly,
>
>my table has more than 32000 record.
>
>************
>>
>SELECT 1
>USE ss
>DO WHILE .t.
>    m.a=name
>    m.a1=p_o_box
>    m.a2=Postal_cod
>    m.a3=degree
>      SELECT 2
>        USE all
>         APPEND BLANK
>        REPLACE name WITH m.a
>        REPLACE p_o_box WITH m.a1
>        REPLACE postalcod WITH m.a2
>        REPLACE degree WITH m.a3
>     SELECT 1
>        SKIP
>        m.aa=name
>        m.aa1=p_o_box
>        m.aa2=postal_cod
>        m.aa3=degree
>     SELECT 2
>     REPLACE name1 WITH m.aa
>     REPLACE p_o_box1 WITH m.aa1
>     REPLACE postalcod1 WITH m.aa2
>     REPLACE degree1 WITH m.aa3
>        SELECT 1
>        SKIP
>       m.aaa=name
>       m.aaa1=p_o_box
>       m.aaa2=postal_cod
>       m.aaa3=degree
>       SELECT 2
>       REPLACE name2 WITH m.aaa
>       REPLACE p_o_box2 WITH m.aaa1
>       REPLACE postalcod2 WITH m.aaa2
>       REPLACE degree2 WITH m.aaa3
>
>      select 1
> *browse
>  if .not. eof()
>     skip
>   else
>     exit
>  endif
>>ENDDO
Previous
Reply
Map
View

Click here to load this message in the networking platform