The Mother Board

Motherboards.org forums. Free tech support, motherboard ID, and more.
It is currently Mon Sep 24, 2018 3:25 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Pascal Help
PostPosted: Sun Sep 05, 2004 9:54 pm 
Offline
Pilgrim
Pilgrim

Joined: Sat Jul 24, 2004 3:06 am
Posts: 5
Hi, i was wondering if anyone can tell me how to change a font color in pascal, i have created a calculator program to calculate how long my bit torrent downloads have left (going at a certain speed) since i have found the eta field to usually be way off, it all works and all but i cant figure out how to change the colors of the fonts to pretty it up.

This is my code

program calculator;

var per, perl, avs, sizemb, sizekb, etasec, etamin, etahour, etaday, mbleft, kbleft : real;

begin;
writeln('This Program will calculate the approximate time for a download');
writeln('Enter the percentage that has been downloaded : ');
read(per);
perl := 100 - per;
while per < 0 and per > 100 do
begin
writeln('This is not a valid percentage');
writeln('Enter the percentage that has been downloaded : ');
read(per)
perl := 100 - per;
end;
writeln('Now enter the total size (in MB) of the file : ');
readln(sizemb);
sizekb := sizemb * 1000;
mbleft := sizemb / 100 * perl;
kbleft := mbleft * 1000;
writeln('Enter the average speed (in KB/s) to calculate for : ');
read(avs);
etasec := kbleft / avs;
etamin := etasec / 60;
etahour := etamin / 60;
etaday := etahour / 24;
if etasec < 60
then writeln('There is only ', etasec:3:1, 'seconds left of this download')
else writeln('There is ', etamin:3:1, ' Minutes left for this download');
if etamin > 60
then writeln('Which is ', etahour:3:1, ' hours left for this download')
else write;
if etahour > 24
then writeln('(', etaday:3:1, ' Day(s) left for the download)')
else write;
readln;
readln;
end.


I want to change the color of
writeln('There is only ', etasec:3:1, 'seconds left of this download')
writeln('There is ', etamin:3:1, ' Minutes left for this download');
then writeln('Which is ', etahour:3:1, ' hours left for this download')

and
writeln('(', etaday:3:1, ' Day(s) left for the download)')

Can Anyone help me?
HeZzA

_________________
P4 3.0 Northwood
2x 512mb ddr400 Corshair (running in dual)
GA-8KNXP
Seagate 120Gb Sata
WD 200Gb Sata
9800 Pro
DVD ROM R/RW
new: Polo735 w/ Atric Silver :) took idle temp down 12 degrees!!!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Sep 08, 2004 6:43 am 
Offline
Black Belt
Black Belt

Joined: Sun Jun 29, 2003 3:58 pm
Posts: 615
Location: South Africa, Cape Town
hi sorry i might have missed something here (hope not though),

to change the color of your output to the screen
I think setColor should be used just before you writeln anything to screen.

eg.

SetColor(5);

end eg.

use any number from 1-16 or (i think)u can specify it like "blue" or " white"

cheers good luck-

_________________
-dve83- Folding for 33258
Gigabyte GA-MA69VM-S2,AMD Athlon X2 5200+, 6GB DDR2-800, Seagate 250GB 7200 RPM, Western Digital 1TB 7200RPM,
460W Coolermaster PSU, Windows 7

"Perhaps it's not paranoia. Perhaps it's just finesse." - dve83


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Sep 08, 2004 5:19 pm 
Offline
Mobo-fu Master
Mobo-fu Master

Joined: Thu Jan 25, 2001 1:01 am
Posts: 19405
Location: 00000h - 0000Fh
http://www.geocities.com/SiliconValley/ ... l1001.html

_________________
"Imagination is the only weapon in the war against reality." -Jules de Gautier

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 10, 2004 1:23 am 
Offline
Black Belt
Black Belt

Joined: Sun Jun 29, 2003 3:58 pm
Posts: 615
Location: South Africa, Cape Town
yeah thats right @ that link. sorry my mistake.

_________________
-dve83- Folding for 33258
Gigabyte GA-MA69VM-S2,AMD Athlon X2 5200+, 6GB DDR2-800, Seagate 250GB 7200 RPM, Western Digital 1TB 7200RPM,
460W Coolermaster PSU, Windows 7

"Perhaps it's not paranoia. Perhaps it's just finesse." - dve83


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Sep 10, 2004 7:45 am 
Offline
Black Belt 2nd Degree
Black Belt 2nd Degree

Joined: Tue Jun 29, 2004 9:05 am
Posts: 2792
Location: St. Augustine, Fl
I know this is a programming forum and hate to bring up the obvious but.... I have nothing better to do. :D

Bit torrent requires a give and take method for this p2p client.
I am sure you are aware of this.

The algorithems alone to "predict" when a torrent file is finished is astounding and uncomprehensible.

Have you checked out the other bit torrent clients?

If you have you can see the client can be manipulated and each version of the client will affect the end user and the person he is drawing files from.
More so you are dealing with peoples whims and that is trouble.

Well best of luck and I would love to see the outcome.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group