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

C/C++ API Documentation | 2025.2

# Displaying P4 Server forms

P4 Server client commands that collect a large amount of input from the user (such as `p4 branch`, `p4 change`, `p4 label`) use ASCII forms. To interact with your end user, your client application program can display P4 Server ASCII forms such as changelists, client specification, and so on. To display a form and collect user input, call `ClientUser::Edit()`, which puts the form into a temporary file and invokes the text editor that is configured for the client machine.

All form-related commands accept the batch mode flags -o and -i:

- -o causes the form to be passed to `ClientUser::OutputInfo()`.
- -i causes the form to be read with `ClientUser::InputData()`.

These flags allow changes to the form to occur between separate invocations of the `p4` application, rather than during a single invocation. (For details about the -o and -i global options, see the P4 Command Reference.)

All form-related commands can return a form descriptor. Your application can use this descriptor to parse forms into constituent variables and to format them from their constituent variables. The `specstring` protocol variable enables this support in the server. Form descriptors are best used with the `tag` protocol variable, which causes the form data to appear using `ClientUser::OutputStat()` rather than `OutputInfo()`.

Select the protocol with `ClientApi::SetProtocol()` as follows:

    client.SetProtocol( "specstring", "" );
    client.SetProtocol( "tag", "" );

Your application can override the `OutputStat()` method in a class derived from `ClientUser`. The P4 API for C/C++ calls this derived method, passing it the output from the command.

Your search for returned results