|
Home > Archive > FoxPro Help and Support > June 2005 > Executable VS Run program in VFP
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Executable VS Run program in VFP
|
|
| Catherine 2005-06-02, 7:25 am |
| Dear all,
Are there any difference between running program in VFP and use
executable to run the program? Because I got the experience that I can run
the program in the VFP and just use 5 minutes to update the records. However,
when I use the executable, it seems hang and no records are updated.
So, what's wrong?
Thanks for any help!
| |
| Dan Freeman 2005-06-02, 11:24 am |
| The runtime is basically all of VFP with a few commands disabled.
Can you give more details about what your app does/how it does it so
somebody can take a shot in the dark at helping you?
Dan
Catherine wrote:
> Dear all,
> Are there any difference between running program in VFP and use
> executable to run the program? Because I got the experience that I
> can run the program in the VFP and just use 5 minutes to update the
> records. However, when I use the executable, it seems hang and no
> records are updated.
>
> So, what's wrong?
>
> Thanks for any help!
| |
| Catherine 2005-06-03, 3:24 am |
| My program is mainly used to insert or update the records, the update table
is on the other server.
Part of the program structure as follow:
....
1. SELECT TABLE_A
2. GO TOP
3. DO WHILE .NOT. EOF()
4. l_staffno = Table_A.staff_no
5. l_name....
6. ...
7. SELECT TABLE_B
8. SET ORDER TO STAFFNO
9. GO TOP
10. LOCATE FOR ALLTRIM(STAFFNO) = ALLTRIM(l_staffno)
11. IF FOUND()
12. REPLACE ......
13. cnt_update = cnt_update + 1
14. ELSE
15. INSERT ....
16. cnt_insert = cnt_insert + 1
17. ENDIF
18. SELECT TABLE_A
19. SKIP
20.ENDDO
....
When run in VFP, It work. But use the executable to run, the program seems
hanged.
Then, I remark line number 12 and 15, and generate the executable again, the
program run smoothly.
Is it something wrong?
Thanks for any help!
"Dan Freeman" wrote:
> The runtime is basically all of VFP with a few commands disabled.
>
> Can you give more details about what your app does/how it does it so
> somebody can take a shot in the dark at helping you?
>
> Dan
>
> Catherine wrote:
>
>
>
| |
| Dan Freeman 2005-06-03, 11:24 am |
| "Appears to hang" is a common problem inside a DO WHILE NOT EOF() loop when
there's one branch of program logic that causes the SKIP not to happen.
If I were you, I'd change the DO WHILE to a SCAN/ENDSCAN which is not
succeptible to terminal loops.
Dan
Catherine wrote:[color=darkred
]
> My program is mainly used to insert or update the records, the update
> table is on the other server.
> Part of the program structure as follow:
>
> ...
> 1. SELECT TABLE_A
> 2. GO TOP
> 3. DO WHILE .NOT. EOF()
> 4. l_staffno = Table_A.staff_no
> 5. l_name....
> 6. ...
> 7. SELECT TABLE_B
> 8. SET ORDER TO STAFFNO
> 9. GO TOP
> 10. LOCATE FOR ALLTRIM(STAFFNO) = ALLTRIM(l_staffno)
> 11. IF FOUND()
> 12. REPLACE ......
> 13. cnt_update = cnt_update + 1
> 14. ELSE
> 15. INSERT ....
> 16. cnt_insert = cnt_insert + 1
> 17. ENDIF
>
> 18. SELECT TABLE_A
> 19. SKIP
> 20.ENDDO
> ...
>
> When run in VFP, It work. But use the executable to run, the program
> seems hanged.
> Then, I remark line number 12 and 15, and generate the executable
> again, the program run smoothly.
> Is it something wrong?
>
> Thanks for any help!
>
>
>
> "Dan Freeman" wrote:
>
| |
| Catherine 2005-06-03, 11:24 am |
| Thanks Dan.
Let me try it on Monday.
"Dan Freeman" wrote:
> "Appears to hang" is a common problem inside a DO WHILE NOT EOF() loop when
> there's one branch of program logic that causes the SKIP not to happen.
>
> If I were you, I'd change the DO WHILE to a SCAN/ENDSCAN which is not
> succeptible to terminal loops.
>
> Dan
>
>
> Catherine wrote:
>
>
>
| |
| Catherine 2005-06-07, 3:24 am |
| I tried but it still not work.
I also tried used For...ENDFOR LOOP to do this procedure. The result is it
is success when I try 100 records, i.e. For i = 1 to 100. However, it seems
hanged again when I try 1000 records.
The total number of records I need to update/insert is 16000 records or more.
How can I solve this problem?
Thanks for any advise.
"Dan Freeman" wrote:
> "Appears to hang" is a common problem inside a DO WHILE NOT EOF() loop when
> there's one branch of program logic that causes the SKIP not to happen.
>
> If I were you, I'd change the DO WHILE to a SCAN/ENDSCAN which is not
> succeptible to terminal loops.
>
> Dan
>
>
> Catherine wrote:
>
>
>
| |
| Dan Freeman 2005-06-07, 11:24 am |
| It may just be taking a long time, which is being seen as a hang. <shrug>
With no more information, nobody can really guess. You've given approximate
code, so all we can give is an approximate answer.
Dan
Catherine wrote:[color=darkred
]
> I tried but it still not work.
> I also tried used For...ENDFOR LOOP to do this procedure. The result
> is it is success when I try 100 records, i.e. For i = 1 to 100.
> However, it seems hanged again when I try 1000 records.
> The total number of records I need to update/insert is 16000 records
> or more. How can I solve this problem?
>
> Thanks for any advise.
>
>
> "Dan Freeman" wrote:
>
| |
| Catherine 2005-06-08, 7:24 am |
| You are right, it just took a long time to do the process so that it seen as
a hang.
After I modified the program, use SEEK instead of LOCATE FOR, the program
run smooth and more faster.
Thanks Dan.
"Dan Freeman" wrote:
> It may just be taking a long time, which is being seen as a hang. <shrug>
>
> With no more information, nobody can really guess. You've given approximate
> code, so all we can give is an approximate answer.
>
> Dan
>
> Catherine wrote:
>
>
>
|
|
|
|
|