Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-08-2016, 21:49
buttignol's Avatar
buttignol buttignol is offline
Registered User
 
Join Date: Sep 2012
Location: Brasil
Posts: 126
Thanks: 102
Thanked 16 Times in 13 Posts
buttignol is on a distinguished road
Help function ProgressPercent

Help function ProgressPercent

I'm trying to use function ProgressPercent

But it works only > LabelPct.Caption: = IntToStr (ProgressPercent) + '%';

I wanted to add + chr (48 + OveralPct mod 10) + '%' '.';

failing to add is not correct (Example: stay like 45.4%)

Can anyone help

Quote:
function ProgressPercent:Integer;
var
pr,i1,i2: Extended;
begin
if (ISDoneProgressBar.Position>ISDoneProgressBar.Min) then begin
i1:=ISDoneProgressBar.Position-ISDoneProgressBar.Min;
i2:=ISDoneProgressBar.Max-ISDoneProgressBar.Min;
pr:=i1*100/i2;
Result:=Round(100*pr/100);;
end;
end;

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAn siChar): longword;
begin
if OveralPct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := OveralPct;

LabelPct.Caption := IntToStr(ProgressPercent)+'.'+chr(48 + OveralPct mod 10)+'%';
LabelCurrFileName.Caption := MinimizePathName(ExpandConstant('{app}\')+CurrentF ile, LabelCurrFileName.Font, LabelCurrFileName.Width);
LabelTime1.Caption := ExpandConstant('{cm:ElapsedTime} ')+TimeStr2;
LabelTime2.Caption := ExpandConstant('{cm:RemainingTime} ')+TimeStr1;
LabelTime3.Caption := ExpandConstant('{cm:AllElapsedTime}')+TimeStr3;
Result := ISDoneCancel;
end;
Thank you
Reply With Quote
Sponsored Links
  #2  
Old 10-08-2016, 14:38
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,751
Thanks: 2,181
Thanked 11,211 Times in 2,309 Posts
Razor12911 is on a distinguished road
Use this

Function FloatToStrDeci(Float: Extended; DeciCount: Integer): String;
Begin
Result:= Format('%.'+IntToStr(DeciCount)+'n', [Float]);
StringChange(Result, ',', ',');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = ',')) and (Pos(',', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

FloatToStrDeci(Float value,The number of decimals you want)
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
buttignol (10-08-2016)
  #3  
Old 10-08-2016, 15:54
buttignol's Avatar
buttignol buttignol is offline
Registered User
 
Join Date: Sep 2012
Location: Brasil
Posts: 126
Thanks: 102
Thanked 16 Times in 13 Posts
buttignol is on a distinguished road
I can not add

LabelPct.Caption :=
Reply With Quote
  #4  
Old 10-08-2016, 16:46
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,751
Thanks: 2,181
Thanked 11,211 Times in 2,309 Posts
Razor12911 is on a distinguished road
Well you have to declare and create one if you can't use the object.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Blackbox Inno Setup Script Kurutucu Conversion Tutorials 1190 18-08-2019 22:43
Useful Dll for Inno Setup users peterf1999 Conversion Tutorials 88 01-12-2017 16:00
Cant get inno setup to decompress archive during installation! surumanboy PC Games 16 29-05-2013 00:26
Progress bar for Tasks danswano PC Games - CD/DVD Conversions 22 09-03-2013 12:09



All times are GMT -7. The time now is 00:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com