Hi,
Can't find this anywhere.
Is it possible to continue a statement on a next line somehow? I have some long texts and I would like it to remain readable in the editor without scrolling.
In VB you would use &_ I think:
sLongText = "the long text" &_
" continues here.";
Does AGS have something like this?
E: Nvm. I read your post too fast. I thought you were asking for breaking line in "Display()" command.
As far as I know, it's not possible.
AGS can handle instructions being split over several lines, but not when it's inside quotes (inside of a string)
The best workaround I can think of is :
String s = "Line #1";
s = s.Append( "Line #2");
s = s.Append( "Line #3");
s = s.Append( "Line #4");
s = s.Append( "Line #5");
Yes, so far I've done the thing with the appends but that feels like a strange workaround. And I read that the translation file doesn't recognize appends so another way of doing this would be welcome.
Just so I know, how does it work when not inside quotes?
When it's not inside quotes, a statement only ends in AGS when you place a semicolon after it. Something like this is valid AGS script:
int
x
;
x
=
0
;
while
(
x
<
10
)
x++
;
Moreover, new lines are treated just like they're spaces. If you need to space things out, any whitespace will do :D
For translations :
if (Game.TranslationFilename =="") {
lText = "My text 1";
lText = lText.Append("and my text 2.");
} else if (Game.TranslationFilename == "French") {
lText = "Mon texte 1";
lText = lText.Append("et mon texte 2");
} else if (Game.TranslationFilename == "Spanish") {
...
}
labCreditText.Text = lText;
Ok thanks. :smiley:
Translation are going to be very unfun this way. :confused:
Quote from: Billbis on Sat 05/07/2014 07:47:18
For translations :
if (Game.TranslationFilename =="") {
lText = "My text 1";
lText = lText.Append("and my text 2.");
} else if (Game.TranslationFilename == "French") {
lText = "Mon texte 1";
lText = lText.Append("et mon texte 2");
} else if (Game.TranslationFilename == "Spanish") {
...
}
labCreditText.Text = lText;
What??
lText = GetTranslation("My text 1");
lText = lText.Append(GetTranslation("and my text 2."));
:-[
Why I haven't thank about that method earlier? Sorry about that.