Jump to content

Split a long line into two lines?


Recommended Posts

I would like to split oversized lines...

Msgbox(0, "An example", "Hello," & @CRLF & "I would like to split this line in half or more parts," & @CRLF & "because it is so long and" & @CRLF & "because it makes my script look so ugly :X")

like so...

Msgbox(0, "An example", "Hello," & @CRLF &
                        "I would like to split this line in half or more parts," & @CRLF &
                        "because it is so long and" & @CRLF &
                        "because it makes my script look so ugly :X")

What must I do?

Link to comment
Share on other sites

I would like to split oversized lines...

Msgbox(0, "An example", "Hello," & @CRLF & "I would like to split this line in half or more parts," & @CRLF & "because it is so long and" & @CRLF & "because it makes my script look so ugly :X")

like so...

Msgbox(0, "An example", "Hello," & @CRLF &
                        "I would like to split this line in half or more parts," & @CRLF &
                        "because it is so long and" & @CRLF &
                        "because it makes my script look so ugly :X")

What must I do?

There is a function called StringSplit($string,$delimit)

An example:

$days = StringSplit("Sun,Mon,Tue,Wed,Thu,Fri,Sat", ",")

MsgBox(0,"",$days[1]) <--- $days[1] = Sun, $days[2] = Mon

For your problem:

Msgbox(0, "An example", $array[1] & @CRLF & $array[2] & @CRLF & $array[3] & @CRLF & $array[4])
Link to comment
Share on other sites

Simply use these symbols: _ (with a space before them)

Msgbox(0, "An example", "Hello," & @CRLF & _
                        "I would like to split this line in half or more parts," & @CRLF & _
                        "because it is so long and" & @CRLF & _
                        "because it makes my script look so ugly :X")

Another example:

GUICreate("blabla", _
50, 50 _
, -1, -1, _
)

this example is of course silly, but it should work. ^^

[font="Courier New"]http://RomanK.hondadesigns.com[/font]
Link to comment
Share on other sites

Simply use these symbols: _ (with a space before them)

Msgbox(0, "An example", "Hello," & @CRLF & _
                        "I would like to split this line in half or more parts," & @CRLF & _
                        "because it is so long and" & @CRLF & _
                        "because it makes my script look so ugly :X")

Another example:

GUICreate("blabla", _
50, 50 _
, -1, -1, _
)

this example is of course silly, but it should work. ^^

Thanks a lot, that's what I was looking for! :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...