hliobasilema
04-02-2009, 10:35 PM
The following is my attempt that did not produce correct results.
Can somebody help me on this?
Thanks...
search_result = RichText.FindText("RichText1", "findthis", 1, -1, false, false);
-- Create a table containing all possible matches.
all_matches = {};
min = search_result.Start+1; -- The number to start at
max = RichText.GetTextLength("RichText1"); -- The number to stop at
step = 1; -- The number to count by
--try to find all matches
for count_var = min, max, step do --beginning of for loop
search_result=nil; --just to avoid confussion with previous references, just in case anyway
search_result = RichText.FindText("RichText1", "findthis", count_var, -1, false, false);
--check to see if it is a match
if (search_result) then
all_matches[(Table.Count(all_matches)+1)]=search_result;
end
end ---end of for loop
------
------
------
------ IF ALL CORRECT UNTILL NOW, THE FOLLOWING SHOULD DISPLAY CORRECT RESULTS
no_of_matches_found = Table.Count(all_matches);
---- BUT THE NUMBER DISPLAYED IS NOT AS EXPECTED! IT IS A REALLY HUGE ONE INSTEAD!
Can somebody help me on this?
Thanks...
search_result = RichText.FindText("RichText1", "findthis", 1, -1, false, false);
-- Create a table containing all possible matches.
all_matches = {};
min = search_result.Start+1; -- The number to start at
max = RichText.GetTextLength("RichText1"); -- The number to stop at
step = 1; -- The number to count by
--try to find all matches
for count_var = min, max, step do --beginning of for loop
search_result=nil; --just to avoid confussion with previous references, just in case anyway
search_result = RichText.FindText("RichText1", "findthis", count_var, -1, false, false);
--check to see if it is a match
if (search_result) then
all_matches[(Table.Count(all_matches)+1)]=search_result;
end
end ---end of for loop
------
------
------
------ IF ALL CORRECT UNTILL NOW, THE FOLLOWING SHOULD DISPLAY CORRECT RESULTS
no_of_matches_found = Table.Count(all_matches);
---- BUT THE NUMBER DISPLAYED IS NOT AS EXPECTED! IT IS A REALLY HUGE ONE INSTEAD!