--- myst: substitutions: bloc1: python: 33-39 cpp: 44-50 bloc2: python: 41,42 cpp: 52,53 dedent: python: ":dedent:\n" cpp: "" --- # Output file Output file formats supported by `TCodeEval` include: - `TFlatResult`, Output file is made up of an header characterised by # as first line character, and a line of floats separated by spaces. By default, it is constructed as the DataServer one (from {{Launch}} module). One can consider using a flat output file written over several lines (so constructed as a `TOutputFileRow`) but one needs to be very careful about the fact that all attributes might not have the same number of entries (when dealing with vectors for instance). This is discussed in the third item of [](#launcher_external_code_input_output_input_input_without_model) and in [](#use_cases_macro_launcher_read_multi_type_row_objective). To do this a specific method has to be called `isMultiLine(string separ)` which says to the class that the results are written over many lines, and every field is separated by the string `separ`. - `TKeyResult`, Value can be found on line composed with the key, a separator, the value and eventually a ; character. A separator is composed with space, tab, = and : characters. - `TLineResult`. All the values of a given `TAttribute` are written on a specific line. Changing attribute means changing line. It is the equivalent of the Column format (from the {{Launch}} module). `TXmlResult` is not provided in this version In a similar way of `TInputFile`, one should use the `addOutput` to declare parameters, the argument being the pointer to the attribute under consideration for all these formats, pairing with the corresponding key when dealing with a `TKeyResult` object. This step can be gathered in a single operation, as for the input file, using the `setOutputs` method. Here is an example for the ongoing {{usecase}}. {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/relauncher/teval_trun/" + language + "/teval_trun." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc1[language] + "\n" + dedent[language] + "```" }} Finally, use the `addOutputFile` method of `TCodeEval` to declare it: {{ "```{literalinclude} " + parent_dir + "/roottest/uranie/doc/relauncher/teval_trun/" + language + "/teval_trun." + extension + "\n" + ":language: " + language + "\n" + ":lines: " + bloc2[language] + "\n" + dedent[language] + "```" }}