Page 1 of 1

Using and Combining Strings

PostPosted: Sat Oct 01, 2005 8:58 pm
by MiG3
I'm new to GE and am having a problem with strings.

I've gone

Script Editor -> Variables -> Add -> Name: YourName; Type: String

and then I try to initiate the variable: YourName="Kieran"

But when I try to exit it says its an incompatible type, etc etc.

In addition, I want to be able to say text= "You are "+YourName+"."

I'm pretty sure thats not how you would say it, but I'd like to be able to end up with something like that. How can you do that?

MiG3

PostPosted: Sat Oct 01, 2005 9:02 pm
by makslane
To assign a string to a variable use this command:
strcpy(YourName, "Kieran");

To concatenate strings use):
strcat(string1, YourName);

Will make the string1 = string1 + YourName

PostPosted: Thu Oct 06, 2005 4:50 pm
by Parrot
Perhaps you should consider including some C++ string class functionality in your next release.