Use a Dialog box with an indicator field.
For details, see in the online help, fct Dialog.OPEN and Dialog.UPDATE
Dialog.OPEN(String [, Variable1], ...)
Dialog
Data type: dialog
Once you define this variable, you can open the dialog and then use other dialog functions.
String
Data type: text constant or code
This string contains the text you want the system to display in the window. Use a back slash (\) to start a new line. Use pound signs (#) to insert variable values into the string, Place the pound signs where you want the system to substitute the variable value.
If you use @ characters instead of #, the string can be used as an indicator. In this case, use @ characters only for the string, and let the variable be an integer. The limits of the indicator are 0 and 9999 - meaning that the integer you use for updating the indicator should have a value within this range.
Some example:
globals:
Name DataType Subtype Length
diaProgress Dialog
intProgress Integer
intProgressI Integer
intProgressTotal Integer
timProgress Time
recSalesLine.RESET; // + filters
diaProgress.OPEN('@1@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\',intProgress);
intProgressTotal := recSalesLine.COUNT; // be carefull : this can be slow if filters don't use the key
// SQL : use COUNTAPPROX, but this doesn't give an exact number
timProgress := TIME;
IF recSalesLine.FIND('-') THEN
REPEAT
// Progress bar
intProgressI := intProgressI + 1;
IF timProgress < TIME - 3000 THEN BEGIN // every 3 seconds
timProgress := TIME;
intProgress := ROUND(intProgressI / intProgressTotal * 10000,1);
diaProgress.UPDATE;
END;
// other things you have to do
UNTIL recSalesLine.NEXT;
diaProgress.CLOSE;
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
You have to define the "intProgress*" as integer.
If you already did that, check if the error isn't in another point. I used that code already thousands of times and never had any problem.
Regards,Alain Krikilion No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Answers
For details, see in the online help, fct Dialog.OPEN and Dialog.UPDATE
Hope that help ...
globals:
Name DataType Subtype Length
diaProgress Dialog
intProgress Integer
intProgressI Integer
intProgressTotal Integer
timProgress Time
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Thank you, it seems to work !!! but i have an error message during the process:
overflow in the conversion of the type Decimal to Integer
value:498,09
what could i do?
thank you!!
If you already did that, check if the error isn't in another point. I used that code already thousands of times and never had any problem.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
RIS Plus, LLC
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!