Hello all!
Can someone tell me why so many people use SPACE$ to presize a string before a file GET or TCP RECV? Am I really supposed to do that or is this done "just in case"? If the GET/TCP RECV calls return a string of a given size then why would you need to presize the string?
Cheers!
Can someone tell me why so many people use SPACE$ to presize a string before a file GET or TCP RECV? Am I really supposed to do that or is this done "just in case"? If the GET/TCP RECV calls return a string of a given size then why would you need to presize the string?
Code:
buffer = space$(len(datablock)) get hfile,,buffer or buffer = space$(len(datablock)) tcp recv hsock, len(datablock), buffer
Comment