Hello PB Team,
ReceiveNetworkData returns the 'Result' of receieve data.
Why does ReadData not do this?
I would expect every read action into a buffer would return
the result of read data, this is much easier then checking
with an extra commandrows howmuch data there was read.
I would suggest to change ReadData into (with extra Result return) ->
***
Result = ReadData(*memory,LengthToRead)
The 'Result' returns the number of byte effectively read. If 'Result' is equal to LengthToRead, then more data is available to be read.
***
This will make PB more consequent and easier too on Read actions

Wheater its a File or a Socket Read actions into Memory would be made easier when there is a result length returned in this case.
PS: If you would like to make Life more easier

also make 1 Read function, that is AND able to read from sockets
AND able to read from files, because the #File will pointout to
the constant, the compiler will know whether its a #PORT or a #FILE.
that would make something like this:
For a FILE :
CID = OpenFile(0,"hello.exe")
ReadData(CID,*buffer,length)
For a Socket (PORT) :
CID = OpenNetWorkConnection("127.0.0.1",port)
ReadData(CID,*buffer,length)
Continueing on this issue you could also extent for
ServerSide sockets like :
CID = NetWorkClientID()
WriteData(cid,*buffer,length)
Anyway..I think using the above you will surely make PB more
flexible and I had a look into the standard functions which shows
me that it IS possible to adjust. Less Functions results into
more Flexible Functions.
I hope you give it a thought, for now the First suggestion
with the result would be a nice enhancement. The Seconds issue
would ofcause meen a new PB release.
Regards,
Norman.