View Single Post
Old 08-08-2010, 02:36 PM
juppmaifeld juppmaifeld is offline
Join Date: Aug 2009
Posts: 43

Hi Nicknack,

I just tried to get the chat example running with ppl 1.53 pro. It failed because ppl 1.53 dosen't know the expresion "var(buffer$, sz$)" in

func tcp_recv(s$, sz$)

local(buffer$, read$);

//var(buffer$, sz$);

// PPL 1.53 dosen't know "var(buffer$, sz$);" therfore I used ->
SDIM(buffer$, TBYTE, sz$);

if (s$ == 0)
s$ = tcp_socket$;

read$ = recv(s$, &buffer$, sz$, 0);

if (read$ < 0)
return ( - 1);
setbyte(&buffer$ + read$, 0);
return (char(buffer$));

To get it running I used "SDIM(buffer$, TBYTE, sz$);" instead of "var(buffer$, sz$);" . It worked but I am not sure whether I will run into a memory problem because I do not explicitly free buffer$ at the end of the function. I hope ppl's garbage collector will take care of it. Am I wrong? Is there an other workaround for var(buffer$, sz$);?

Realy good stuff what you have done.

Reply With Quote