Switching between tagged and untagged output

Info & Tags

Article #:
247
Created:
12/15/06
Modified:
10/27/08
Tags:
api, c, c++, tagged output, untagged output

Related Articles

Links

  1. C/C++ API Documentation
    Documentation

PROBLEM

How do I switch between tagged and untagged output?
How do I revert back to tagged output for a command?


SOLUTION

To switch between tagged and untagged ouput, the current connection must be closed and a new one opened with the appropriate SetProtocol() arguments. Since ClientApi::SetProtocol() must be called before ClientApi::Init(); you cannot change the tagged setting for the connection while the connection is active. To enable tagged output for a command that supports it, set the tag variable to any value.

The following example demonstrates the use of SetProtocol() to enable tagged output. The result of this call is that the ClientUser object uses OutputStat() to handle the output, rather than OutputInfo().

ClientApi client;
Error e;
client.SetProtocol("tag", "");
client.Init( &e );
client.Run("branches", &ui);
client.Final( &e );

For more information on ClientApi::SetProtocol(), please consult the latest C/C++ API documentation. Please note that the C/C++ API documentation is version specific and subject to change between releases.