[fpc-pascal] serwrite

Marco van de Voort marcov at stack.nl
Wed May 30 18:38:28 CEST 2007


> I have written this function where I use serwrite (unit serial). 
> If I call 
> 
>   serial.serwrite(prn,pchar(f.bufptr),f.bufPos);
> 
> like this, it puts out garbage.

That's odd. It is supposed to write "bufpos" bytes, the first 4 (or 8 on
64-bit) are the exact values of the pointer (p.bufptr) you want to write.

In the case you want to write the content the pointer points TO, try

pchar(f.bufptr)[0]  or f.bufptr^ if that is allowed (I don't know what
bufptr exactly is)




More information about the fpc-pascal mailing list