Input text to Global variable

Game Editor comments and discussion.

Input text to Global variable

Postby Clokio » Sun May 29, 2011 4:00 am

How to put the content of a input text into a Global variable?

Thanks
Last edited by Clokio on Sun Feb 26, 2012 10:04 pm, edited 1 time in total.
Clokio
 
Posts: 229
Joined: Tue May 17, 2011 2:18 pm
Score: 32 Give a positive score

Re: Input text to Global variable

Postby skydereign » Sun May 29, 2011 5:43 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron