Hi, I have created a progress bar but for some reason or another it starts immediately from 100% instead of progressing from 1% to 100%. The following is the code.
Unfortunately still not working I don't know why..... What I am doing is uploading records through a dataport and I want to show the upload progress but it is starting from 100% immediately.
What should "1" update? Which variable should there set?
Is the Window.upadate in a loop or in a dataport or where?
Normally the souirce for a progressbar in a dialog looks like this:
Counts := FromSomewhere.counts; //or countapprox <- need updated statistics
i := 0;
Window.open('My little progress bar: @1@@@@@@@@');
if CONDITION then begin
repeat
i += 1;
Window.update(1,round(i*100/counts*100,1));
until LOOPSTOPCOMMAND;
end;
Window.close;
What should "1" update? Which variable should there set?
Is the Window.upadate in a loop or in a dataport or where?
1 is Updating TEXT004 which is a constant i.e. the one that populates the progress bar
Window.update is in a dataport OnAfterImportRecord() trigger and there is no need loops for loops i think
So... OnAfterImportRecord() trigger I have the following code:
Unfortunately still not working I don't know why..... What I am doing is uploading records through a dataport and I want to show the upload progress but it is starting from 100% immediately.
Can you help please?
Regards
Errm, (feels like there might be a do'h moment coming ...)
Where are you getting your total count from?
Are you getting it from the empty table before the import ... are there zero records in the table?
For a Import dataport you use
Window.UPDATE(1, ROUND(CurrFile.POS / CurrFile.LEN * 10000, 1));
Comments
You probably ment
The second argument must be an integer in the range 0 to 10000 so:
I usually round down to reduce the 'still running at 100%' effect.
TVision Technology Ltd
Can you help please?
Regards
What should "1" update? Which variable should there set?
Is the Window.upadate in a loop or in a dataport or where?
Normally the souirce for a progressbar in a dialog looks like this:
Regards
1 is Updating TEXT004 which is a constant i.e. the one that populates the progress bar
Window.update is in a dataport OnAfterImportRecord() trigger and there is no need loops for loops i think
So... OnAfterImportRecord() trigger I have the following code:
And in PreDataport() trigger I have the following:
Where:
Name ConstValue
Text003 Filename:
Text004 Progress:
Is it better this way?? Can you help please??
Regards
Errm, (feels like there might be a do'h moment coming ...)
Where are you getting your total count from?
Are you getting it from the empty table before the import ... are there zero records in the table?
For a Import dataport you use
Window.UPDATE(1, ROUND(CurrFile.POS / CurrFile.LEN * 10000, 1));
TVision Technology Ltd