Start of trail quanser.communications.stream.set_character_format navigation bar

Table of Contents

quanser.communications.stream.get_character_format

Returns the character format of the stream.

Syntax

[format, err] = stream.get_character_format
    

Description

Returns the character format used by the functions that send and receive characters. The result of this function may change after the first receive operation has been performed on the stream since the character format is determined automatically by default from the byte order mark, if present, at the beginning of the stream.

The FORMAT output will be one of the t_stream_format enumeration values:

STREAM_FORMAT_AUTO

= character format is determined from byte order mark (if present) read from the stream.

STREAM_FORMAT_UTF8

= using the Unicode UTF8 character set (8-bit Unicode)

STREAM_FORMAT_UTF16

= using the Unicode UTF16 character set (16-bit Unicode)

STREAM_FORMAT_UTF32

= using the Unicode UTF32 character set (32-bit Unicode)

STREAM_FORMAT_MULTIBYTE

= using a multibyte character set

This operation is not valid on listening streams created using quanser.communications.stream.listen.

If no err output is provided then it throws an exception if an error occurs. In generated code it prints the error message. Use qc_get_error_message to get the message associated with an error code.

Parameters

stream

Stream handle returned by quanser.communications.stream.connect or accept.

Outputs

This function has no outputs.

Examples

        fmt = stream.get_character_format;    % Gets the character format of the specified stream.
    

See Also

 

navigation bar