endl: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category:[ _]?Scripting[ _]Commands[ _]Arma[ _]3(\|.*)]]" to "{{GameCategory|arma3|Scripting Commands}}")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Command|Comments=
{{Command|Comments=
____________________________________________________________________________________________


| arma3 |Game name=
| arma3 |Game name=
Line 7: Line 6:


|gr1= Strings |GROUP1=
|gr1= Strings |GROUP1=
____________________________________________________________________________________________


| 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 14: Line 12:
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.
  |DESCRIPTION=
  |DESCRIPTION=
____________________________________________________________________________________________


| '''endl''' |SYNTAX=
| '''endl''' |SYNTAX=


| [[String]] - line break |RETURNVALUE=
| [[String]] - line break |RETURNVALUE=
____________________________________________________________________________________________
   
   
|x1= <code>[[diag_log]] ("line1" + [[endl]] + "line2");</code> |EXAMPLE1=
|x1= <code>[[diag_log]] ("line1" + [[endl]] + "line2");</code> |EXAMPLE1=
Line 26: Line 22:
_ctrl [[ctrlCommit]] 0;  
_ctrl [[ctrlCommit]] 0;  
_ctrl [[ctrlSetText]] [[format]] ["line1%1line2%1line3", [[endl]]];</code> |EXAMPLE2=
_ctrl [[ctrlSetText]] [[format]] ["line1%1line2%1line3", [[endl]]];</code> |EXAMPLE2=
____________________________________________________________________________________________


| [[lineBreak]], [[str]], [[format]], [[toString]], [[joinString]], [[splitString]], [[toArray]] |SEEALSO=
| [[lineBreak]], [[str]], [[format]], [[toString]], [[joinString]], [[splitString]], [[toArray]] |SEEALSO=

Revision as of 01:14, 17 January 2021

Hover & click on the images for description

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

See also:
lineBreakstrformattoStringjoinStringsplitStringtoArray

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

Notes

Bottom Section

Posted on July 15, 2020 - 11:50 (UTC)
7erra
toArray endl results in [13, 10]. toString [13, 10] is therefore equivalent (or at least very similar) to endl.