Page 1 of 1

Input text to Global variable

PostPosted: Sun May 29, 2011 4:00 am
by Clokio
How to put the content of a input text into a Global variable?

Thanks

Re: Input text to Global variable

PostPosted: Sun May 29, 2011 5:43 am
by skydereign
You have to use strcpy, which takes the contents of the second string and copies it to the first string. So, if you have a string variable named globalStringVariable, and a text actor named textActorName, this would copy the text actor's text into the variable.
Code: Select all
strcpy(globalStringVariable, textActorName.text);


-Edit
And to answer the question you had that you deleted, you can use the atoi or atof function. It converts a string into an integer/float.