Page 1 of 1

Network File While

Posted: Thu Jun 02, 2005 9:50 pm
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"...

Posted: Mon Jun 06, 2005 1:33 pm
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!

Posted: Mon Jun 06, 2005 1:39 pm
by Tranquil
This syntax does not make sence.

The Sytnax of ReceiveNetworkFile is:


Syntax

ReceiveNetworkFile(ConnectionID, FileName$)

Posted: Mon Jun 06, 2005 4:50 pm
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

Posted: Mon Jun 13, 2005 1:25 pm
by Dummy
Tranquil wrote:This syntax does not make sence.
Why?

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