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 Discussion / Case sensitivity for a database?

Author
Message
Adam Prime
17
Years of Service
User Offline
Joined: 26th Jan 2008
Location:
Posted: 26th Jan 2008 13:22 Edited at: 26th Jan 2008 14:02
Hi everybody,
I'm new to programming (although I spent a few hours with my ZX Spectrum back in the day) and I'm trying to make a database.

Now, the problem is I need to make the input from the user non-case sensitive, if you see what I mean. Here's an example:

print "Enter search topic ";
input i$
if i$="watermelon" then -

So, how do I make it so that "Watermelon", "WATERMELON" and "wAtermelon" all work as if you'd typed in "watermelon"?
I remember in Qbasic, you'd type LET i$ = LCASE$($). Is there anything to that effect in Darkbasic? I've looked in every help file I can find, to no avail.

EDIT: (I forgot something
Also, my database involves bringing up large amounts of text. How can I make it stay within the screen, in paragraphs? See, when it prints text, it just goes off the edge in one long line.

Thanks guys, I hope you can help me!
Sinani201
18
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 26th Jan 2008 17:55 Edited at: 26th Jan 2008 18:00
Gaaaah! Code tags aren't working for me. Look up UPPER$ in the help file.

Seriously, how do you make the little blue text come up below your message?
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 26th Jan 2008 18:14 Edited at: 26th Jan 2008 18:20





Formerely Cool Guy Jordan
Zeus
18
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 26th Jan 2008 18:19 Edited at: 26th Jan 2008 18:19
My bad DBP....


Formerely Cool Guy Jordan
Dabbler
18
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 26th Jan 2008 20:08
It won't work with DBP either. What you want is this:

You were trying to compare an upper case string to a lower case string. You would never get a match. Think it through.


Whatever...
Adam Prime
17
Years of Service
User Offline
Joined: 26th Jan 2008
Location:
Posted: 26th Jan 2008 21:05
Thanks guys!! That was awesome.

Any advice on keeping the text on the screen? Or could I load up a .txt file, instead of typing reams of text into the editor?

Thanks again!
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Jan 2008 21:53
yes you could LOAD a text file and OPEN it and READ STRINGS from it, the commands to do all that are pretty easy to guess, open up your help file index and look for them

Adam Prime
17
Years of Service
User Offline
Joined: 26th Jan 2008
Location:
Posted: 27th Jan 2008 19:08
Thanks, OBese87. I eventually got that working. So I can get it to read strings and print them to the screen, but I still can't stop the words going off the side of the screen in one long line. Other than going through and breaking it up, is there a way to stop that?
Phantom 2590
18
Years of Service
User Offline
Joined: 19th Apr 2007
Location: Earth...
Posted: 29th Jan 2008 00:41 Edited at: 29th Jan 2008 01:05
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 29th Jan 2008 05:36
Quote: "I still can't stop the words going off the side of the screen in one long line"


As covered in another thread, I've posted a function in Code Snippets which can be used to print text to the screen so it is placed within the boundaries of a specified rectangle - including automatic scrolling.

TDK_Man

Login to post a reply

Server time is: 2025-06-04 02:03:40
Your offset time is: 2025-06-04 02:03:40