Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.1

# ClientApi::SetVersion( const char * )

Sets the application or script version for this connection.

Virtual? | No |
Class | `ClientApi` |
Arguments | `const char *c` | the new version number
Returns | `void` |

## Notes

`SetVersion()` sets the version number of a client application as reported by the `p4 monitor -e` command, or as recorded by server logging.

If a client application compiled with version 2005.2 or later of the API does not call `SetVersion()`, then the version string reported by `p4 monitor -e` (and recorded in the server log) defaults to the pass:[<literal>api</literal> value appropriate for the server level as per `SetProtocol()`.

Call `SetVersion()` after calling `Init()` and before each call to `Run()`.

## See also

`ClientApi::SetProtocol()``ClientApi::SetProg()`

## Example

The following example appears as `2005.2` in the output of `p4 monitor show -e`.

    ClientApi client;
    ClientUser ui;
    Error e;

    client.Init( &e );
    client.SetVersion( "2005.2" );
    client.Run( "info", &ui );

Your search for returned results