/n - Need help with newline :S

Hello, I cant get the /n command to work, hel me !

Code:
[lua] local CinemaINFO = vgui.Create( “DLabel” )
CinemaINFO:SetText( “This is the In-Game Source Recorder”…
“me likes icecream” )
CinemaINFO:SetParent( CinemaRecorder )
CinemaINFO:SetPos( 5, 20 )
CinemaINFO:SetTextColor( Color(188, 247, 53, 255) )
CinemaINFO:SizeToContents( ) [/lua]

You don’t need to concatenate the newline character with the text, it is an escape character.

[lua]CinemaINFO:SetText( “This is the In-Game Source Recorder
me likes icecream” )[/lua]

Thank you sir ! The mystery is finnaly over :S

Also, remember it’s
not /n (as you wrote it in the title).

You can do it like this to make it more visually appealing.
[lua]
print(
"Because they don’t rhyme
"…
"Haikus don’t really make sense
"…
“Why did I write that?”
);
[/lua]

[lua]
print(
"They’re happy
"…
"Because they eat
"…
“LARD”
);
[/lua]
:downs:

semicolons are not visually appealing

:wink:

If you actually program it is visually appealing

Fix’d

yeah

Here’s a little secret. If you use the [[string]] way then you can type text in literally.
[lua]print[[Haikus are great
but sometimes they don’t make sense
refrigerator]][/lua]

Technically, [[ and ]] will escape all characters within the string.

Fix’d.

You didn’t fix anything. You don’t need parenthesis when calling single argument functions in Lua, though often grounded upon for it’s lack of organization depending on the reader.

[editline]11:44PM[/editline]

Grounded = frowned

iPhone :l

Oh really, I had no idea. Thanks for telling me that.

You can only drop the parentheses when the first and only argument to the function is a string (or table).

Incorrect, it can be any form of string or a table.
The table use is handy if there are lots of optional configuration options in a function. Instead of having lots of parameters which you might leave as nil sending a table as the only parameter.

Ineed, I completely forgot about tables.

Woah, I’ve never seen that before. Is it only in Lua or is it available in other programming languages?