Release 10.1A: OpenEdge Development:
Progress 4GL Reference

> ## WRITE( ) method

> Writes data to the socket.

> Return type: LOGICAL

> Applies to: Socket object handle

> Syntax
>     WRITE( buffer , position , bytes-to-write )

> ``buffer``

> A MEMPTR expression which contains data which should be written to the socket.

> ``position``

> An INTEGER expression greater than 0 that indicates the starting byte position within `buffer` which should be written to the socket.

> ``bytes-to-write``

> An INTEGER expression that specifies the number of bytes to be written to the socket.

> WRITE( ) returns TRUE if the write operation succeeded normally and returns FALSE otherwise. An error can occur if:

> - The position parameter is not greater than 0.
> - Amount of information requested to write exceeds the amount of data in the buffer.
> - Writing to the socket fails.

> This method expects `buffer` to identify a MEMPTR variable which already has a region of memory associated with it. The developer must call the SET-SIZE statement to allocate memory and associate it with a MEMPTR variable. It is the responsibility of the developer to free this memory, also via the SET-SIZE statement. The WRITE method will fail if the size of `buffer` is less than `bytes-to-write`.

> #### Note

> Even if the WRITE( ) method returns TRUE, not all the bytes may have actually been written. To find out how many bytes were written, check the BYTES-WRITTEN attribute.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095