[Gambas-user] Question READ WRITE in V3

Benoît Minisini gambas at ...1...
Tue Nov 12 14:50:10 CET 2013


Le 12/11/2013 14:44, nando a écrit :
> Thanks Benoit, but actually, my question wasn't about how to get help for V2,
> it was
>
> is it still true that WRITE #file, s, 14
> will only write 14 bytes and NOT write the length first
> (as it did in other versions)

WRITE #hfile, s, 14 never wrote the string length first, neither in 
Gambas 2 or Gambas 3.

If you specify the length, only the string contents is written. No 
length first.

The change between Gambas 2 and Gambas 3 is that now, a specific syntax 
is used to write the binary representation of a data:

WRITE #hFile, expr AS type

So now, `WRITE #hFile, expr` will always write the contents of `expr` 
converted to a string.

The Gambas 2 syntax was badly ambiguous, hence the new syntax.

Regards,

-- 
Benoît Minisini




More information about the User mailing list