Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

string concatenation

Jaydin Normandy
Registered User
Join date: 1 Apr 2006
Posts: 19
11-05-2008 12:48
Will someone please tell me what's wrong with the 3rd line? I'm losing my mind:

string a = "hello";
string b = " world";
string ab = a + b;
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
11-05-2008 12:52
Is it at the very top of the script? If so, move it into state_entry or some other event handler.

Can't do non-constant initializations in the global area at the top of the script...
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
11-05-2008 12:59
From: Meade Paravane
Can't do non-constant initializations in the global area at the top of the script...


I beg to differ, I do this in my scripts just fine.
Cappy Frantisek
Open Source is the Devil!
Join date: 27 Oct 2006
Posts: 400
11-05-2008 13:05
From: Jaydin Normandy
Will someone please tell me what's wrong with the 3rd line? I'm losing my mind:

string a = "hello";
string b = " world";
string ab = a + b;


Can you be more specific, there isn't anything wrong with line three that i see.

edited- you can't do the concatenation in the global area.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
11-05-2008 13:08
From: Cappy Frantisek
I beg to differ, I do this in my scripts just fine.

From: Cappy Frantisek
edited- you can't do the concatenation in the global area.

Er..
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Jaydin Normandy
Registered User
Join date: 1 Apr 2006
Posts: 19
string concatenation
11-05-2008 13:08
Will someone please tell me what's wrong with the 3rd line? I'm losing my mind:

string a = "hello";
string b = " world";
string ab = a + b;
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
11-05-2008 13:11
Check your other thread on this, Jaydin: /54/75/291243/1.html
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Darien Caldwell
Registered User
Join date: 12 Oct 2006
Posts: 3,127
11-05-2008 13:32
From: Meade Paravane
Er..


*give Meade a passing hug * ;)
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
11-05-2008 13:46
Woooo!!!
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
11-05-2008 14:01
CODE

string a = "hello";
string b = " world";
string ab = "";

state_entry()
{
ab = a+" "+b+" ";
llSetText(ab,<1,1,1>,1);
}


not sure if that would work, im a bit tired XD
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
11-05-2008 18:22
mergificates...
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
11-05-2008 23:41
for this test script to work, you need to have "default" in there
From: Mrc Homewood

string a = "hello";
string b = " world";
string ab = "";

default//wasn't in there
{//and need a bracket here
state_entry()
{
ab = a+" "+b+" ";
llSetText(ab,<1,1,1>,1);
}
}// and here

_____________________
Dark Heart Emporium

http://www.xstreetsl.com/modules.php?name=Marketplace&MerchantID=133020

want more layers for tattoos, specifically for the head? vote here
http://jira.secondlife.com/browse/VWR-1449?

llDetectedCollision* Functions similar to touch
http://jira.secondlife.com/browse/SVC-3369
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
11-06-2008 01:55
and I'll assume, that the op didnt need any extra spaces =X

esentially it boils down to not being able to use variables or functions int the global area (before/outside a state) you can get away with some simple math IIRC (like 1+3 or some such... may even be able to combine rotations, never tried).... too bad as several things could be so much easier to preconfigure, although temptation would be high for some people
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -