Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
Actually, the way I have it coded, it's counting how many instances of "tabela criada" are found. Notice that the count only increments if the aqString.Find call finds the target text in the line.
so, if you have a file that looks like this:
Count will return 2 because it will only increment for those two lines found. I just tested it out myself with the same text above. There are two edits I needed to make.
First, change the ">0" to ">=0".
Second, at the end of the routine, add Call LogFile.Close()
Other than that, this code returned a correct count of 2.
Now, the problem that MAY happens is if you have a file that looks like this
My code as it is written will incorrectly return 3 as the count instead of 4. If that is the case, that there may be more than one "tabela criada" per line, I'd have to modify the code. Is this the case? Or will there only be one "tabela criada" per line?
so, if you have a file that looks like this:
blahblah
blahblah
blahblah
tabela criada
blahblah
blahblah
blahblah
tabela criada
Count will return 2 because it will only increment for those two lines found. I just tested it out myself with the same text above. There are two edits I needed to make.
First, change the ">0" to ">=0".
Second, at the end of the routine, add Call LogFile.Close()
Other than that, this code returned a correct count of 2.
Now, the problem that MAY happens is if you have a file that looks like this
blahblah
blahblah
blahblah tabela criada
tabela criada tabela criada
blahblah
blahblah
blahblah
tabela criada
My code as it is written will incorrectly return 3 as the count instead of 4. If that is the case, that there may be more than one "tabela criada" per line, I'd have to modify the code. Is this the case? Or will there only be one "tabela criada" per line?