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 / picking out of a sentence

Author
Message
BB9 Brad
20
Years of Service
User Offline
Joined: 6th Oct 2003
Location:
Posted: 5th Dec 2003 21:52
hi i think this has been posted a while back but i couldnt find it sorry... so.. could any one please help? i want to be able to let the program no if there is a certain word in a sentence is that possible?


and is it possible to use db to open the cd tray?

any help is appreciated thank you

DB RULES!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Dec 2003 22:32
you would need to get the sentence into s string variable then use Instr() funtion to find the sought term

-RUST-
KNau
21
Years of Service
User Offline
Joined: 25th Nov 2002
Location: Canada
Posted: 5th Dec 2003 23:29
I'm not familiar with the Instr() command and it doesn't appear to be listed in the help files. Is this a seperate function that someone created?

If you want to do it manually I've included some code here. It basically runs through your sentence and searches for letters that match the first letter in the word you are looking for. It then checks the following letters to see if they add up to the search string. I've commented it so it should be pretty easy to follow - it looks long but it's mostly my comments and some display code you don't really need.

I hope it's what you are looking for

http://www.canceriannewmedia.com
BB9 Brad
20
Years of Service
User Offline
Joined: 6th Oct 2003
Location:
Posted: 6th Dec 2003 00:45
yes thanks

DB RULES!
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 6th Dec 2003 17:48
isn't instr() a VB command?

Morfy's Law - Enythink thet ken go rong willll.
Cole's Law - Thinly sliced cabbage.
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 6th Dec 2003 18:03 Edited at: 6th Dec 2003 18:05
Instr() is common to about 99% of all Basic languages, except DarkBasic, which is a tad annoying

Anyway it's easy enough to make your own:


Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 6th Dec 2003 18:24
I know how to live without it, but I was surprised when he said DB had it.

Morfy's Law - Enythink thet ken go rong willll.
Cole's Law - Thinly sliced cabbage.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Dec 2003 18:35
oops-my brain is fried. heh heh INSTR() in dbp - lol
please forive my vb programmer arse, I am snowed in at a friends house without access to my dbp, I thought it was in the language...

sorry

-RUST-
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 6th Dec 2003 20:28
i think someones made a plugin(probably tca) which included instr() as one of the functions. can't remember who though...


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!

Login to post a reply

Server time is: 2024-09-21 12:02:15
Your offset time is: 2024-09-21 12:02:15