Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progressbar
Message
From
13/05/2005 22:31:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/05/2005 22:07:31
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01014147
Message ID:
01014150
Views:
21
You can create your own form class, containing the controls required to show the progress bar. The basic idea is to have special methods to start it (displaying an appropriate caption), and to update it at regular intervals (basically, you might pass a number between 0 and 1, to indicate percentage completed, and perhaps a variable text, like "5 of 10000 records processed").

Or better, save yourself some work, and search the download section, for "progress", or for "thermometer". There are several to choose from.

Additional notes:

1) Starting with FoxPro 2.0 or something, you no longer need the points with logical operators. You can type AND instead of .AND., for example.

2) You can combine the two SUM commands into a single SUM command. This would be faster.

3) You can also use more "modern" SQL commands to replace part of your code. Often this helps make your code shorter, and quite often, also faster. I think the equivalent would look more or less like this:
select Fdate1, sum(dr_amount) as dr1, sum(cr_amount) as cr1;
  from vouchers;
  where fdate1 between ldStartDate and ldEndDate;
  group by fdate1;
  having dr1 > 0 or cr1 > 0;
  into cursor Temp
scan
  insert into cash_f (date, debit, credit);
    values (Temp.fdate1, Temp.dr1, Temp.cr1)
endscan
Only a little shorter in this case, but it seems to me that it is easier to understand, once you get accustomed to the alternate syntax. Also, I think it will execute much faster, because you are avoiding the repeated SUM accross the entire table. Despite Rushmore Optimization, this may take quite a while.

To copy records from one table to another, see also SCATTER ... NAME and GATHER NAME.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform