Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-02-2015, 19:53
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
Help - Progress Percents

Can I add one more decimal in progress percents?

1.1% --> 1.13%

Like In Black Box v2
Reply With Quote
Sponsored Links
  #2  
Old 08-02-2015, 21:18
pakrat2k2's Avatar
pakrat2k2 pakrat2k2 is offline
Moderator
 
Join Date: Apr 2005
Location: Canada
Posts: 7,209
Thanks: 3,040
Thanked 9,043 Times in 3,086 Posts
pakrat2k2 is on a distinguished road
start reading here in this topic, few posts / pages, shows how it should be.

http://fileforums.com/showpost.php?p...&postcount=220
Reply With Quote
  #3  
Old 09-02-2015, 00:12
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
Quote:
Originally Posted by pakrat2k2 View Post
start reading here in this topic, few posts / pages, shows how it should be.

http://fileforums.com/showpost.php?p...&postcount=220
Please show me through this script
Quote:
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAn siChar): longword;
var
Remaining: Integer;
begin
if OveralPct<=Wizardform.ProgressGauge.Max then
Wizardform.Progressgauge.Position := OveralPct;
Result := ISDoneCancel;
with WizardForm.ProgressGauge do begin
WizardForm.Caption:='Installing - <<{#AppName}>>';
if OveralPct>0 then
begin
WizardForm.Caption:='Installing - <<{#AppName}>>'+(' Wait:' + TimeStr1);
end;
WizardForm.StatusLabel.Caption :='Unpacking Archives '+IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
WizardForm.FilenameLabel.Caption :=' Extracting File: '+ MinimizePathName(CurrentFile, WizardForm.FilenameLabel.Font, WizardForm.ProgressGauge.Width-ScaleX(80));
end;
end;
Reply With Quote
  #4  
Old 09-02-2015, 07:01
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

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


/////////////////////////////////////////////////Example/////////////////////////////////


function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAn siChar): longword;
var
Remaining: Integer;
begin
if OveralPct<=Wizardform.ProgressGauge.Max then
Wizardform.Progressgauge.Position := OveralPct;
Result := ISDoneCancel;
with WizardForm.ProgressGauge do begin
WizardForm.Caption:='Installing - <<{#AppName}>>';
if OveralPct>0 then
begin
WizardForm.Caption:='Installing - <<{#AppName}>>'+(' Wait:' + TimeStr1);
end;
if WizardForm.ProgressGauge.Max <> 0 then
WizardForm.StatusLabel.Caption :='Unpacking Archives ' + NumToStr((WizardForm.ProgressGauge.Position * 100) / WizardForm.ProgressGauge.Max) + '%';
WizardForm.FilenameLabel.Caption :=' Extracting File: '+ MinimizePathName(CurrentFile, WizardForm.FilenameLabel.Font, WizardForm.ProgressGauge.Width-ScaleX(80));
end;
end;
Reply With Quote
The Following 3 Users Say Thank You to Razor12911 For This Useful Post:
BLACKFIRE69 (02-06-2019), Compiler (09-02-2015), pakrat2k2 (09-02-2015)
  #5  
Old 09-02-2015, 19:45
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
It gives whole number not two decimals
Reply With Quote
  #6  
Old 10-02-2015, 12:08
gozarck's Avatar
gozarck gozarck is offline
Registered User
 
Join Date: Nov 2013
Location: Argentina
Posts: 163
Thanks: 254
Thanked 495 Times in 114 Posts
gozarck is on a distinguished road
Quote:
Originally Posted by Bilawal View Post
Please show me through this script
Quote:
function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAn siChar): longword;
var
Remaining: Integer;
begin
if OveralPct<=Wizardform.ProgressGauge.Max then
Wizardform.Progressgauge.Position := OveralPct;
Result := ISDoneCancel;
with WizardForm.ProgressGauge do begin
WizardForm.Caption:='Installing - <<{#AppName}>>';
if OveralPct>0 then
begin
WizardForm.Caption:='Installing - <<{#AppName}>>'+(' Wait:' + TimeStr1);
end;
WizardForm.StatusLabel.Caption :='Unpacking Archives '+IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
WizardForm.FilenameLabel.Caption :=' Extracting File: '+ MinimizePathName(CurrentFile, WizardForm.FilenameLabel.Font, WizardForm.ProgressGauge.Width-ScaleX(80));
end;
end;
In your script try to change


Code:
'+IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
To this

Code:
'+IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+''+chr(48 + OveralPct mod 5)+'%';


maybe this help you
Reply With Quote
The Following 3 Users Say Thank You to gozarck For This Useful Post:
Bilawal (10-02-2015), mausschieber (10-02-2015), pakrat2k2 (10-02-2015)
  #7  
Old 10-02-2015, 18:26
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
This convert progress %age to

Quote:
1.1% --> 1.11%
1.2% --> 1.22%
1.3% --> 1.33%
1.4% --> 1.44%
1.5% --> 1.50%
1.6% --> 1.61%
I like it somehow but i don't like repeating of two decimals.

I like this way in Black Box v2

It give

Quote:
1.1% --> 1.13%

then

1.1% --> 1.17%

then goes to

1.2%
Can you do that???
Reply With Quote
  #8  
Old 12-02-2015, 15:01
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
did you try my example in ansi or unicode?
Reply With Quote
  #9  
Old 12-02-2015, 21:51
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
yes
Quote:
Originally Posted by Bilawal View Post
It gives whole number not two decimals
Reply With Quote
  #10  
Old 13-02-2015, 10:03
pakrat2k2's Avatar
pakrat2k2 pakrat2k2 is offline
Moderator
 
Join Date: Apr 2005
Location: Canada
Posts: 7,209
Thanks: 3,040
Thanked 9,043 Times in 3,086 Posts
pakrat2k2 is on a distinguished road
Quote:
Originally Posted by Bilawal View Post
yes
what kind of answer is that ? He asked used ansi OR Unicode. Which did you try in ? if you tried both then say both, otherwise how is he to help ?
Reply With Quote
  #11  
Old 14-02-2015, 05:49
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
Quote:
Originally Posted by pakrat2k2 View Post
what kind of answer is that ? He asked used ansi OR Unicode. Which did you try in ? if you tried both then say both, otherwise how is he to help ?
Unicode
Reply With Quote
  #12  
Old 23-02-2015, 05:48
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 updated function

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


/////////////////////////////////////////////////Example/////////////////////////////////


function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAn siChar): longword;
var
Remaining: Integer;
x1, x2: extended;
begin
x1:=Wizardform.Progressgauge.Position;
x2:=Wizardform.Progressgauge.Max;
if OveralPct<=Wizardform.ProgressGauge.Max then
Wizardform.Progressgauge.Position := OveralPct;
Result := ISDoneCancel;
with WizardForm.ProgressGauge do begin
WizardForm.Caption:='Installing - <<{#AppName}>>';
if OveralPct>0 then
begin
WizardForm.Caption:='Installing - <<{#AppName}>>'+(' Wait:' + TimeStr1);
end;
if WizardForm.ProgressGauge.Max <> 0 then
WizardForm.StatusLabel.Caption :='Unpacking Archives ' + NumToStr((x1 * 100) / x2) + '%';
WizardForm.FilenameLabel.Caption :=' Extracting File: '+ MinimizePathName(CurrentFile, WizardForm.FilenameLabel.Font, WizardForm.ProgressGauge.Width-ScaleX(80));
end;
end;
Reply With Quote
The Following User Says Thank You to Razor12911 For This Useful Post:
pakrat2k2 (23-02-2015)
  #13  
Old 25-02-2015, 18:09
Bilawal's Avatar
Bilawal Bilawal is offline
Registered User
 
Join Date: Apr 2014
Location: Pakistan
Posts: 127
Thanks: 176
Thanked 175 Times in 51 Posts
Bilawal is on a distinguished road
This gives

1.1% ---> 11%

means no decimal.

Tested in unicode.
Reply With Quote
  #14  
Old 26-02-2015, 16:45
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
lol, then there is something that I am not doing right. i used the same approach with the R.G. Mechenics script, will look through it.
Reply With Quote
  #15  
Old 26-02-2015, 21:46
y_thelastknight's Avatar
y_thelastknight y_thelastknight is offline
Registered User
 
Join Date: Mar 2010
Location: Canada
Posts: 437
Thanks: 616
Thanked 576 Times in 213 Posts
y_thelastknight is on a distinguished road
i used another format for that now i forget that what i did.
let me check my source first.
__________________
Glass BB | BlackBox v2 | Portable Installer
Reply With Quote
The Following 2 Users Say Thank You to y_thelastknight For This Useful Post:
Bilawal (28-02-2015), Razor12911 (26-02-2015)
Reply


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
How to use IsArcextract without mentioning progress bar Alash Als Conversion Tutorials 0 30-09-2014 07:05
Inno Setup - Progress Bar, Help Needed silentnight512 PC Games - CD/DVD Conversions 4 28-12-2013 14:15
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 07:21.


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