Counting String Cases Based on Multipe Target Strings
Posted: Thu Feb 25, 2016 3:27 am
Hey I rewrote this post, because I don't think my initial example was very good or concise. Let me get down to it,
I'm looking to add a criterion to the target string argument in the @instr command, so that the resulting integer value is calculated not just by how many times a singular target string is counted, but rather multiple targets in terms of an "and" logical context. I could use the following if I wanted a logical "or":
This way, !string_count would go up by 1 every time either of the members of %targets is found. However, for my purposes I need something with more exclusivity, more of a logical "and". Like if %list has "a/b" AND "c/d" then !string_count goes up by 1.
What should I do in this situation?
I'm looking to add a criterion to the target string argument in the @instr command, so that the resulting integer value is calculated not just by how many times a singular target string is counted, but rather multiple targets in terms of an "and" logical context. I could use the following if I wanted a logical "or":
Code: Select all
%targets "a/b c/d"
for %i {%targets}
!string_count = !string_count+@instr(%list,%i)
next
What should I do in this situation?