Page 1 of 1
Matchtext - looking for chars in each line of a list of word
Posted: Thu Oct 22, 2015 4:45 pm
by SethMould
repeat for each line temp in tAnswers
put 0 into nCount
if matchtext(temp,"*" & char 1 of tGuess & "*") then
add 1 to nCount
end if
I get an Error in the third statement
Re: Matchtext - looking for chars in each line of a list of
Posted: Thu Oct 22, 2015 7:04 pm
by FourthWorld
SethMould wrote:I get an Error in the third statement
What does the error say?
Re: Matchtext - looking for chars in each line of a list of
Posted: Thu Oct 22, 2015 7:56 pm
by dunbarx
The problem is runtime, and in the matchText line.
Does this make sense:
Code: Select all
if matchtext(temp, char 1 of tGuess & "*") then
Craig Newman
Re: Matchtext - looking for chars in each line of a list of
Posted: Thu Oct 29, 2015 5:17 pm
by elanorb
Hi Seth
I think you need to specify what the * is allowed to match, so something like
Code: Select all
put matchtext(temp,"[a-zA-Z]*" & char 1 of tGuess & "[a-zA-Z]*")
This resource, which Charles Buchwald pointed to in the Dictionary comments, is really useful
http://www.regextester.com/index.html
I hope that helps.
Kind regards
Elanor