Page 1 of 1 1
Topic Options
#195845 - 2009-09-10 02:58 PM Line Break
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1850
Loc: Hilversum, The Netherlands
In VBS you can do a line break, like:
 Code:
"some string" &_
"some other string"

Is there a KiX variant?

I know, strange question comming from me, but I never had the need to do so, and I never believe in line breaks, but now I am in a position where I have to do so \:\)

Top
#195846 - 2009-09-10 03:01 PM Re: Line Break [Re: Arend_]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4636
Loc: The Netherlands
 Code:
"some string" +
"some other string"


Should work just fine.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#195847 - 2009-09-10 03:17 PM Re: Line Break [Re: Mart]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4396
Loc: USA
I would do it exactly like Mart did, but in truth it would work without the "+" just fine. I think "Free Format" is the word in the manual.
Top
#195848 - 2009-09-10 03:29 PM Re: Line Break [Re: Allen]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Without the + is IMHO not the same
 Code:
$RC = "aze"
"rty"
???
? "Var RC = " $RC

$RC = "aze" +
"rty"
???
? "Var RC = " $RC

Output to screen:
 Code:
rty



Var RC = aze



Var RC = azerty

Top
#195849 - 2009-09-10 04:05 PM Re: Line Break [Re: Witto]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4396
Loc: USA
I guess I should have been more clear. If you are just displaying text to the screen, no "+" is needed. But as witto says... it don't works so good without a "+" with vars.

Edited by Allen (2009-09-10 04:06 PM)

Top
#195851 - 2009-09-10 04:40 PM Re: Line Break [Re: Allen]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
It works with any construct where you can insert whitespace.

The KiXtart interpreter treats all whitespace (space, tab, newline) the same in almost all circumstances. Comments are one obvious exception, and I think I've encounter one or two others.

It is often useful to break up long function calls:
 Code:
$foo=Bar(
    $Parameter1,
    $Parameter2,
    $Parameter2
    )


It's a personal choice, but when it comes to catenating long strings I prefer to put the operator at the start of the line to make it clear that it is a continuation, for example instead of:
 Code:
$LongString="This " +
    "is a string " +
    "of many parts!"

I prefer
 Code:
$LongString="This"
    + " is a string"
    + " of many parts!"

Top
#195855 - 2009-09-10 05:01 PM Re: Line Break [Re: Richard H.]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
If you don't like Tabs
 Code:
$LongString = 'Blablabla'
$LongString = $LongString + 'RestOfBlaBlaBla'
$LongString = $LongString + ' And Add Some NagNagNag'

Top
#195893 - 2009-09-14 09:12 AM Re: Line Break [Re: Witto]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1850
Loc: Hilversum, The Netherlands
Thanks guys!
I should have been more specific.
the code would be something like:
 Code:
$arrTest = "test1","test2","test3"
"test4","test5"


Edited by apronk (2009-09-14 09:12 AM)

Top
#195895 - 2009-09-14 09:17 AM Re: Line Break [Re: Arend_]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1850
Loc: Hilversum, The Netherlands
So in effect:
 Code:
$arrTest = "test1","test2","test3"
+ "test4","test5"

Top
#195899 - 2009-09-14 10:20 AM Re: Line Break [Re: Arend_]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4945
Loc: Leatherhead, Surrey, UK
 Originally Posted By: apronk
So in effect:
 Code:
$arrTest = "test1","test2","test3"
+ "test4","test5"


No that would be incorrect - you are catenating test3 and test4 when presumably you intend to create an array of 5 elements.

All you need to do is put @CRLF where you could put a space or tab character, so your code should look like:
 Code:
$arrTest = "test1","test2","test3"
    ,"test4","test5"


It's your choice on which line you place the comma across the split, it should work as the final character on the first line or the first (non-whitespace) character on the second.

Top
#195905 - 2009-09-14 03:51 PM Re: Line Break [Re: Richard H.]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1850
Loc: Hilversum, The Netherlands
That simple huh, and here I am thinking complicated like joining symbols as I used to in MSL (mIRC Scripting Language) like $+
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (KevinOfOz) and 155 anonymous users online.
Newest Members
phanhuyen345, msmile032, bellamabel2018, lmnopq098068, nathanjame
17561 Registered Users

Generated in 0.034 seconds in which 0.011 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org