Network File While

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
BinoX
User
User
Posts: 46
Joined: Mon Jan 31, 2005 11:57 am

Network File While

Post by BinoX »

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
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

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
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

This syntax does not make sence.

The Sytnax of ReceiveNetworkFile is:


Syntax

ReceiveNetworkFile(ConnectionID, FileName$)
Tranquil
TerryHough
Enthusiast
Enthusiast
Posts: 781
Joined: Fri Apr 25, 2003 6:51 pm
Location: NC, USA
Contact:

Post by TerryHough »

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
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

Tranquil wrote:This syntax does not make sence.
Why?

Callbacks are the best solution for displaying the progress of things(eg downloads)!
Post Reply