endl: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...) |
||
Line 1: | Line 1: | ||
{{Command | {{Command | ||
| arma3 | | arma3 | ||
|1.70 | |1.70 | ||
|gr1= Strings | |gr1= Strings | ||
| Creates a string containing a line break, similar to [[lineBreak]] for [[text]]. The name is inspired by c++ std::endl ('''end''' '''l'''ine). The command returns "\r\n", which contains control characters rather than printable characters: | | Creates a string containing a line break, similar to [[lineBreak]] for [[text]]. The name is inspired by c++ std::endl ('''end''' '''l'''ine). The command returns "\r\n", which contains control characters rather than printable characters: | ||
Line 11: | Line 11: | ||
* <tt>[[hint]] [[str]] [[count]] [[endl]]; // 2</tt> | * <tt>[[hint]] [[str]] [[count]] [[endl]]; // 2</tt> | ||
The line break works for [[diag_log]] and [[ctrlSetText]]. It doesn't work with the [[hint]] because [[hint]] interprets printable "\n" as line break instead. Alternatively one can use [[toString]] command to get other characters. | The line break works for [[diag_log]] and [[ctrlSetText]]. It doesn't work with the [[hint]] because [[hint]] interprets printable "\n" as line break instead. Alternatively one can use [[toString]] command to get other characters. | ||
| [[String]] - line break | | '''endl''' | ||
| [[String]] - line break | |||
|x1= <code>[[diag_log]] ("line1" + [[endl]] + "line2");</code> | |x1= <code>[[diag_log]] ("line1" + [[endl]] + "line2");</code> | ||
|x2= <code>_ctrl = [[findDisplay]] 46 [[ctrlCreate]] ["RscTextMulti", -1]; | |x2= <code>_ctrl = [[findDisplay]] 46 [[ctrlCreate]] ["RscTextMulti", -1]; | ||
_ctrl [[ctrlSetPosition]] [0,0,1,1]; | _ctrl [[ctrlSetPosition]] [0,0,1,1]; | ||
_ctrl [[ctrlCommit]] 0; | _ctrl [[ctrlCommit]] 0; | ||
_ctrl [[ctrlSetText]] [[format]] ["line1%1line2%1line3", [[endl]]];</code> | _ctrl [[ctrlSetText]] [[format]] ["line1%1line2%1line3", [[endl]]];</code> | ||
| [[lineBreak]], [[str]], [[format]], [[toString]], [[joinString]], [[splitString]], [[toArray]] | | [[lineBreak]], [[str]], [[format]], [[toString]], [[joinString]], [[splitString]], [[toArray]] | ||
}} | }} |
Revision as of 00:34, 18 January 2021
Description
- Description:
- Creates a string containing a line break, similar to lineBreak for text. The name is inspired by c++ std::endl (end line). The command returns "\r\n", which contains control characters rather than printable characters: The line break works for diag_log and ctrlSetText. It doesn't work with the hint because hint interprets printable "\n" as line break instead. Alternatively one can use toString command to get other characters.
- Groups:
- Strings
Syntax
- Syntax:
- endl
- Return Value:
- String - line break
Examples
- Example 1:
diag_log ("line1" + endl + "line2");
- Example 2:
_ctrl = findDisplay 46 ctrlCreate ["RscTextMulti", -1]; _ctrl ctrlSetPosition [0,0,1,1]; _ctrl ctrlCommit 0; _ctrl ctrlSetText format ["line1%1line2%1line3", endl];
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note