Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Upper casing a text variable

Author
Message
Doveyy04
12
Years of Service
User Offline
Joined: 30th Apr 2012
Location:
Posted: 7th Jul 2012 21:42
After a starttextinput command and gettextinput command can I then print the text entered in uppercase letters even if it was entered in lowercase, also if the text entered was say 12 characters long can I just print only the first 10 character or less if I wanted. Thanks for any help
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Jul 2012 00:15
Use the command 'Upper(str)' to convert to upper case and 'Left(str,10)' to show up to the first 10 characters.

Cheers,
Ancient Lady
AGK Community Tester
Doveyy04
12
Years of Service
User Offline
Joined: 30th Apr 2012
Location:
Posted: 8th Jul 2012 22:36
Sorry to sound so dumb but I stil can't get my string to print uppercase or trim characters, After the gettextinputcompleted I put upper (teamname$) then left(teamname$,10) then Createtext (1,teamname$) but it still prints in lower case.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 8th Jul 2012 23:02
try teamnames$ = upper(teamnames$)

It's a function, so you need to get what it returns.

-- Jim
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 8th Jul 2012 23:05 Edited at: 9th Jul 2012 23:39
Show us your actual code and we can troubleshoot. But, your code should look something like this...



or



I used to hate the thought of governments having orbital mind control satellites,
but now I can't really seem to care.
Doveyy04
12
Years of Service
User Offline
Joined: 30th Apr 2012
Location:
Posted: 8th Jul 2012 23:24
Thanks guys that's sorted it, simple when u know how lol
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 8th Jul 2012 23:47
Glad we could help.

In AppGameKit, functions do not directly change any of the parameters which you put in brackets. They do something to them, and then "return" a result. For example, Sin(x) doesn't change the value x, it sends you a new "x" value. So Sin(x) alone does nothing. But newx = Sin(x) puts the result into newx.

-- Jim

Login to post a reply

Server time is: 2024-11-27 10:52:56
Your offset time is: 2024-11-27 10:52:56