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

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$;
end;

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

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

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.

Jupp
Reply With Quote