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.

DarkBASIC Professional Discussion / Help! Lowercase and Uppercase issue

Author
Message
Mad3inpoland
16
Years of Service
User Offline
Joined: 25th Apr 2010
Location:
Posted: 25th Apr 2010 14:22
Hello world. I searched the forums and google to find out out to make a game accept lowercase and uppercase letters and no luck yet. Right now my Hangman game works only with lowercase and I would like it to accept uppercase letters when guessed as well as lowercase. Right now if I guess a letter in uppercase, nothing happens, but in lowercase the game works fine. Please help!
sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 25th Apr 2010 15:02
Just use:

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Apr 2010 15:04
1. You didn't tell us anything about what method you are currently using to read keypresses so we can only guess at what to tell you.

If you are using Inkey$() then use Upper$() on all input and only check for capital letters.

2. As a newcomer to the forums (and DB I assume), with very basic questions like these you really should stick to the Newcomers board and read the following thread:

http://forum.thegamecreators.com/?m=forum_view&t=116024&b=10

All are relevant, but points 4 and 7 in particular.

This thread will be moved to the Newcomers board in the next 24 hours.

TDK

sladeiw
17
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 25th Apr 2010 15:28 Edited at: 25th Apr 2010 15:28
Quote: "
If you are using Inkey$() then use Upper$() on all input and only check for capital letters.
"


He said the game works fine with lower case letters already, so the simple addition of converting all input to lower case should solve the problem. No need to make it extra complicated!
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 25th Apr 2010 15:35
Fair point.

I never suggest that others do something I don't do myself and in this situation, I have always used Upper$(), so that's what I suggested.

Both methods are exactly the same, but as he didn't give us any info on what his code is currently doing, there's no way of knowing what is involved to switch to using either method.

TDK

Mad3inpoland
16
Years of Service
User Offline
Joined: 25th Apr 2010
Location:
Posted: 26th Apr 2010 08:53
Ok great well I will have to give that a shot. Sorry, I didn't provide the right info. Basically I just want the Hangman game to accept a guess from a user in uppercase and use that to play the game. I have my finished game so far that I can attach because I'm not sure which part you are referring to. I can attach it to show you cause it woulld be too long of a post otherwise. Thanks for the responses guys and any help is much appreciated. : )
Mad3inpoland
16
Years of Service
User Offline
Joined: 25th Apr 2010
Location:
Posted: 27th Apr 2010 03:15
I tried to use the lower$ as mentioned but still no luck. I'll keep trying and searching the darkbasic book for it.

Login to post a reply

Server time is: 2026-07-26 04:27:47
Your offset time is: 2026-07-26 04:27:47