PDA

Click to See Complete Forum and Search --> : Need some help here (yes to much to explain in the title)


lumin
Jan 2nd, 2000, 05:30 PM
hi.

I have a problem I can't solve.
Im trying to get a program to recognize text in a text box.

for example:
if a user types in:help in the text1 text box the text2 text box will display help information. (this is somewhat easy :)

but I also want the program to recognize cammands from text2 text box like if the text2 textbox displays help it will display the help thing in text2. (I find this difficult)
Confused ?

the problem is realy to recognize the things in text2 and then execute the commands.
it must scann the whole line of text that is written.

like if a user types. "I need help"
the help thing activates again.

It would also be nice if someone know how to make the program check with a text file to see if the users username is written there or not. if the username isthere then execute command, if not then do nothing. (I also have major problems with this :)

Hope you understand what my problem is.

Thanks in advance.


-Lumin

Björn
Jan 2nd, 2000, 06:54 PM
Hi !

I'm not sure if I understand this.

Try this:

Sub Text1_Change()

Select Case UCase$(Text1.Text)
case "I NEED HELP"
Text2.Text = "You'll get your help..."

case "I NEED MORE"
Text2.Text = "You'll get more..."

End Select


End Sub

------------------
EMAIL: shareware@lycosmail.com

PAGE: <A HREF="http://members.xoom.com/sharetools
" TARGET=_blank>http://members.xoom.com/sharetools
</A>

Jan 2nd, 2000, 07:32 PM
If you just want to check specific words, use the InStr function.

InStr Function

Returns a Variant (Long) specifying the position of the first occurrence of one string within another.

Syntax

InStr([start, ]string1, string2[, compare])

The InStr function syntax has thesearguments:

start: Optional.Numeric expression that sets the starting position for each search. If omitted, search begins at the first character position. If start contains Null, an error occurs. The start argument is required if compare is specified.

string1: Required.String expression being searched.

string2: Required. String expression sought.

compare: Optional. Specifies the type ofstring comparison. If compare is Null, an error occurs. If compare is omitted, the Option Compare setting determines the type of comparison.


------------------

Vincent van den Braken
EMail: azzmodan@azzmodan.demon.nl
ICQ: 15440110 (http://www.icq.com/15440110)
Homepage: http://www.azzmodan.demon.nl





[This message has been edited by Azzmodan (edited 01-03-2000).]