Need help with textbox finding keywords?

Get help using Construct 2

Post » Wed Jun 26, 2013 3:49 pm

Hello everybody :D
I need to set up so construct 2 could read my textbox and say if there are/are not any specific words or letters. Please help! Is it even possible?

Example :
textbox1.text = hello friend
*need to find word hello* ----> there is "hello" (1)
or -----> there is no "hello" (0)

Help!
B
6
S
2
Posts: 38
Reputation: 1,214

Post » Wed Jun 26, 2013 4:10 pm

The System function "find" is here for you. It helps you find the index where your specific word starts in the text passed in argument, and returns -1 if it's not present.

From the Manual :
find(src, text)
Find the first index within src that text occurs, else returns -1.
B
17
S
8
G
4
Posts: 461
Reputation: 6,077

Post » Wed Jun 26, 2013 5:29 pm

Omg, thanks alot!
B
6
S
2
Posts: 38
Reputation: 1,214


Return to How do I....?

Who is online

Users browsing this forum: ddabrahim, Momio, MSNbot Media and 7 guests