Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / More FTPs questions

Author
Message
RisTar
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 20th May 2003 17:54
1. "CD.." command ? how to do that , i need to do something like this
if z$ = "cd.." then (get back to the previous folder)
2. download ,, well i know how to download but i want to know 2 things , how can i tell how many time left to the download , and how to creat some kind of percent line , like power in rpg , when the download finish it will get to the end .

please if u can help , help 1!!!
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 20th May 2003 19:48
2: You need to know how big the file is in total and how much of it you have so far. Im not sure how you do this as i have never worked with ftp programs (well, never coded one), but if you can find the two values then heres the calculation you need to make a progress bar:

P = (CS * 100) / TS

CS = Current Size (ie, how much you have downloaded so far) and TS = Total Size (how big the complete file is)

That calculates a percentage basically. When you first start and you have none of the file yet then P will = 0, when you have it all then P will = 100. You can use that to draw a line, like

Line 0, 10, P, 10

That will draw a line from the very left of the screen, 10 pixels down from the top upto 100 (when p is complete) pixels along. A pratical example of how to use this for you:



Thats basically stolen streight out of my load map function for my game, but i changed the text to say Downloading instead of loading It will make a progress bar (white with a black outline) which slowly fills blue as your file downloads and it also displays the percentage complete inside the bar. It will also write "Downloading.." in the center of the screen (the progress bar appears just above the bottom of the screen), that code also clears the screen with a black (or was it white, cant remember) box. Obviously you will want to change it to suite your needs ect, but it shows how it can be done.

Quick note, if 100pixels is too big for your bar.. just use P / 2 or similar. P / 2 will mean a complete bar is 50pixels big.. * 2 would be 200 pixels big, ect ect. Once you calculated P you can perform anything on it to get the final size you want

p4 2.4ghz, 256ddr ram, Geforce4 MX 440
Innovate, redefine, recreate whats in your mind. It isnt fate, you decide, only you can cross that line.
RisTar
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 20th May 2003 21:57
tell u the truth i didnt got it ! , with the progrss bar thing !

Login to post a reply

Server time is: 2024-09-20 09:40:48
Your offset time is: 2024-09-20 09:40:48