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.

Newcomers DBPro Corner / text serach problem

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 5th May 2007 09:19
using dbpro

Wanting to make a key holder that stores video game & program keys. need it to read input and seach the keys inside the program and print the name of the game/program and output the key asighned to it. The problem is i am not sure how to get it to sift through the data.

so far i have this.

and this is where it basically stops cause im not sure of the search method. help would be appreciated

A child's dream never dies.
Twu Kai
19
Years of Service
User Offline
Joined: 2nd Oct 2005
Location:
Posted: 5th May 2007 12:38 Edited at: 5th May 2007 21:25
Well, I don't quite understand your code, but the second time you type 'input$' isn't spelled right. Also, 'strnum' needs to go before the 'len' command if you want the variable to equal the length of the string. Here's the code:


Try making an array of strings that can hold the data you want to search, then in a 'For/next' loop search for the key word.
Something like this:


You can use the Bmid$ function if it's any use to you for this.

Hope I helped.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 5th May 2007 14:50
Thank you for answering my post its deeply appreciated.
To many varialbes for my brain to handel like to keep stuff simple as possible.
It was exactly what i was looking for.
works perfect thanks man.




A child's dream never dies.
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 5th May 2007 14:56
You need a function called Instr() - which just happens to be in my string function library. It returns the numeric character position of any substring in another string.

You would use it on array items in a loop to find what the user types in.

Here's a link to Dark Coder's string function library thread, but mine is there to download too.

http://forum.thegamecreators.com/?m=forum_view&t=102344&b=6

TDK_Man

Login to post a reply

Server time is: 2024-11-25 17:56:05
Your offset time is: 2024-11-25 17:56:05