[Gambas-user] Error in file read when length is a negative value ?

T Lee Davidson t.lee.davidson at gmail.com
Sun Jan 17 14:56:03 CET 2021

On 1/17/21 2:38 AM, Vinode Singh Ujlain wrote:
> Please see attached project.
> *read stream length* returns the same string regardless of + /- length given. As per documentation , a negative length should 
> return characters from end of file
> -- 
> Warm Regards,
> Vinode Singh Ujlain
> https://www.linkedin.com/in/ujlain/
> --------------------------------------------------------------------------------------------------------------------------------

I don't see where you're seeing that a negative length should read from the end of the file. What I see is:
"If Length is negative, then at most (- Length) bytes are read until the end of the stream."

Use a negative number to prevent trying to read past EOF and causing an error.


More information about the User mailing list