Using and Combining Strings

Game Editor comments and discussion.

Using and Combining Strings

Postby MiG3 » Sat Oct 01, 2005 8:58 pm

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
MiG3
 
Posts: 12
Joined: Sat Oct 01, 2005 8:34 pm
Score: 0 Give a positive score

Postby makslane » Sat Oct 01, 2005 9:02 pm

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
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Parrot » Thu Oct 06, 2005 4:50 pm

Perhaps you should consider including some C++ string class functionality in your next release.
Parrot
 
Posts: 36
Joined: Sun Sep 25, 2005 9:04 pm
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron