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

If you need help on how to use the program
Post Reply
ABNormal
Posts: 135
Joined: 2005-01-08 08:33:38

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

Post 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?
antp
Site Admin
Posts: 9668
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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.
ABNormal
Posts: 135
Joined: 2005-01-08 08:33:38

Post by ABNormal »

of course!

thank you very much, as always!
ABN
Post Reply