Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   How to combine strings? (http://www.alice.org/community/showthread.php?t=7100)

Dj Tech42 08-16-2011 12:50 PM

How to combine strings?
 
Is there a way to combine string variables? Like a concatenation operator in programming?

I want to add a string to part of another string.

InsertName 08-16-2011 12:54 PM

I've been wondering about this too. I think we can just do series of variables.

legolizard 08-16-2011 01:10 PM

Why don't you just make 3 vairbales add text to the first two and then set the third one eqaul to variable 1 joined with variable 2?:confused:

Dj Tech42 08-16-2011 01:21 PM

[QUOTE=legolizard;40772]set the third one eqaul to variable 1 joined with variable 2?:confused:[/QUOTE]

How do you do that?

Nighthawk0973 08-16-2011 02:41 PM

Say you have a variable called 'ScoreDisplay Part 1' and it's value is "Score: " with the space included. Next you have an interget named 'Score' and it's value is 25 cause that's the users score. Now you have a string called 'ScoreDisplay' and you set it's value to 'default string' inside of a method. After that you need to go and replace 'default string' with the function 'A joined with B' under the world section, A is going to be 'ScoreDisplay Part 1' and B is going to be 'Score'. This makes 'ScoreDisplay' == "Score: 25".

Anyways mess with it and you'll learn more. If you odn't know how to do something try searching through the world functions and camera functions, they can prove to be really helpful and self explanitory.

Dj Tech42 08-16-2011 03:30 PM

[QUOTE=Nighthawk0973;40780]Say you have a variable called 'ScoreDisplay Part 1' and it's value is "Score: " with the space included. Next you have an interget named 'Score' and it's value is 25 cause that's the users score. Now you have a string called 'ScoreDisplay' and you set it's value to 'default string' inside of a method. After that you need to go and replace 'default string' with the function 'A joined with B' under the world section, A is going to be 'ScoreDisplay Part 1' and B is going to be 'Score'. This makes 'ScoreDisplay' == "Score: 25".

Anyways mess with it and you'll learn more. If you odn't know how to do something try searching through the world functions and camera functions, they can prove to be really helpful and self explanitory.[/QUOTE]

Thanks! Never knew about that function!

x2495iiii 08-16-2011 03:40 PM

Good eye, nighthawk.


All times are GMT -5. The time now is 03:13 AM.

Copyright ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.