Page 1 of 1

how to control if a word is included in a variable?

Posted: 2006-01-19 15:15:43
by ABNormal
i'm studying a new script
the web site has not a search otion but offers a list with links.

i should analyze if a word (example "Rain") is included in a title so...
Bread & Roses = NO
Rain Maker = YES
Rain Man = YES

which can be a right instruction into my script to control if into a variable (MovieTitle) is included the variable with the word (AskedWord)?

i have to prepare a script line similar to
if MovieTitle <INCLUDES> AskedWord PickTreeAdd(MovieTitle, MovieAddress);

Thx a lot
ABN

PS: how to convert both variables in lower case (Rain=rain) for a more accurate control?

Posted: 2006-01-19 19:16:37
by antp

Code: Select all

if Pos(AnsiLowerCase(AskedWord), AnsiLowerCase(MovieTitle)) > 0 then ...
LowerCase(...) also works, but AnsiLowerCase(...) handle accents and other language-specific things.

Posted: 2006-01-19 19:41:56
by ABNormal
of course!

thank you very much, as always!
ABN