| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Oct 29, 2003 12:06 pm Post subject: Download Help |
|
|
I think there maybe a bug in VDSIPP.DLL the following script works great:
| Code: | if @not(@null(%A))
list add,1,Starting Download .....
list assign,list1,1
list close,1
rem ** Download the file **
INTERNET HTTP,DOWNLOAD,1,@dlgtext(edit1),%A
rem ** Get the file size of the file and then set the
rem progress **
%C = ""
%S = @internet(http,content-length,1)
repeat
if @not(@equal(%S,0))
dialog set,progress1,@format(@fmul(@fdiv@internet(http,transferbytes,1),%S),100),3.0)
end
%C = @event()
until @not(@null(%C))
goto %C
end |
This script does not work:
All that is changed.
| Code: | if @not(@null(%A))
list add,1,Starting Download .....
list assign,list1,1
list close,1
rem ** Download the file **
INTERNET HTTP,DOWNLOAD,1,@dlgtext(edit1),%A
rem ** Get the file size of the file and then set the
rem progress **
%C = ""
%S = @internet(http,content-length,1)
repeat
if @not(@equal(%S,0))
%%down = @internet(http,transferbytes,1)
dialog set,progress1,@format(@fmul(@fdiv(%%down,%S),100),3.0)
end
%C = @event()
until @not(@null(%C))
goto %C
end |
I have even tried to assign the transfered bytes to an edit box and then assign it to a var. Still does not work.
Nathan
vdsipp.dll version i am using is: 3.10.22.2003 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Oct 29, 2003 1:16 pm Post subject: |
|
|
Are you sure that you didn't switch the two samples? In the one that should be working you missed the
opening parentheses for @fdiv ....
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Oct 29, 2003 1:20 pm Post subject: |
|
|
Sorry my mistake, but the first example works and the second does not, is this a VDS5 or vdsipp bug?
I think there maybe a bug in VDSIPP.DLL the following script works great:
| Code: | if @not(@null(%A))
list add,1,Starting Download .....
list assign,list1,1
list close,1
rem ** Download the file **
INTERNET HTTP,DOWNLOAD,1,@dlgtext(edit1),%A
rem ** Get the file size of the file and then set the
rem progress **
%C = ""
%S = @internet(http,content-length,1)
repeat
if @not(@equal(%S,0))
dialog set,progress1,@format(@fmul(@fdiv(@internet(http,transferbytes,1),%S),100),3.0)
end
%C = @event()
until @not(@null(%C))
goto %C
end |
This script does not work:
All that is changed.
| Code: | if @not(@null(%A))
list add,1,Starting Download .....
list assign,list1,1
list close,1
rem ** Download the file **
INTERNET HTTP,DOWNLOAD,1,@dlgtext(edit1),%A
rem ** Get the file size of the file and then set the
rem progress **
%C = ""
%S = @internet(http,content-length,1)
repeat
if @not(@equal(%S,0))
%%down = @internet(http,transferbytes,1)
dialog set,progress1,@format(@fmul(@fdiv(%%down,%S),100),3.0)
end
%C = @event()
until @not(@null(%C))
goto %C
end |
I have even tried to assign the transfered bytes to an edit box and then assign it to a var. Still does not work. |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Wed Oct 29, 2003 3:49 pm Post subject: |
|
|
Can you try this?
| Code: | if @not(@null(%A))
list add,1,Starting Download .....
list assign,list1,1
list close,1
rem ** Download the file **
INTERNET HTTP,DOWNLOAD,1,@dlgtext(edit1),%A
rem ** Get the file size of the file and then set the
rem progress **
%C = ""
%S = @internet(http,content-length,1)
repeat
if @not(@equal(%S,0))
%%down = @internet(http,transferbytes,1)
info "If this works, the error is in the next line: "%%Down
dialog set,progress1,@format(@fmul(@fdiv(%%down,%S),100),3.0)
end
%C = @event()
until @not(@null(%C))
goto %C
end |
I added a little info line, so you can see if that causes the error or not. I also added the [ code ] tag to your posts, for better reading...  _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Oct 29, 2003 4:00 pm Post subject: |
|
|
Hello Nathan,
I've emailed you the http example modified with your code and it does work. You will need to check your custom script to see if you are setting the %%down variable anywhere else in your code.
Since you noted @internet(http,transferbytes,1) works then there is no bug within vdsipp. The assigning of the variable %%down is handled directly within VDS itself and not with vdsipp. VDSIPP only provides the value and since you said the function does work the value is in fact returning correctly.
It sounds like your variable %%down is being changed somewhere else thus causing it to 'not work'.
If if still 'does not work' it would be helpful if you post any error messages or exactly what is not working. You will also want to check to see if your script is not using the maximum number of variables allowed in VDS.
Test the http example that I emailed you and please post your results here. |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Oct 29, 2003 4:17 pm Post subject: |
|
|
I can't get it to work, no matter what i try.
I basically what a small util, that i can enter the url of a file to download, and it caculates the average KB/Sec. Nothing else, I don;t even need a progress bar
Any help is gratefully accepted.
Nathan |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Oct 29, 2003 4:22 pm Post subject: |
|
|
Did the example I sent you work?
What error number are you getting when you try to run YOUR code?
I really would love to help but you haven't offered me an error number and/or exactly what is 'not working'. |
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|