Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BinoX
User
Posts: 46 Joined: Mon Jan 31, 2005 11:57 am
Post
by BinoX » Thu Jun 02, 2005 9:50 pm
It would be nice to see something like the following functionality:
Code: Select all
WHILE ReceiveNetworkFile(ConnectionID, FileName, *Status)
MessageRequester("Status", "Current File Size: " + Str(Status), 0)
Delay(1000)
WEND
Basically you can use RecieveNetworkFile to run a loop while it is sending and puts the number of bytes downloaded so far into whatever variable you specify for "Status"...
Dummy
Enthusiast
Posts: 162 Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:
Post
by Dummy » Mon Jun 06, 2005 1:33 pm
You Mean
Code: Select all
Procedure ReceiveFileCB(ID.l, File.s, Position.l)
PrintN(File+": "+Str(Position))
EndProcedure
ReceiveNetworkFile(ID.l, File.s, @ReceiveFileCB())
That would be nice!
Last edited by
Dummy on Tue Jun 14, 2005 1:07 pm, edited 1 time in total.
Tranquil
Addict
Posts: 952 Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe
Post
by Tranquil » Mon Jun 06, 2005 1:39 pm
This syntax does not make sence.
The Sytnax of ReceiveNetworkFile is:
Syntax
ReceiveNetworkFile(ConnectionID, FileName$)
Tranquil
TerryHough
Enthusiast
Posts: 781 Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:
Post
by TerryHough » Mon Jun 06, 2005 4:50 pm
Take a look at
viewtopic.php?t=12656&start=15
ind FTP for all OSs topic.
The example FTP conversation uses the PB networking commands to do just that.
See the link to my code near the end of the topic.
TerryHough
Dummy
Enthusiast
Posts: 162 Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:
Post
by Dummy » Mon Jun 13, 2005 1:25 pm
Tranquil wrote: This syntax does not make sence.
Why?
Callbacks are the best solution for displaying the progress of things(eg downloads)!