I've has another look at the code. The issue is more than likely that 'Scanner-Scan Up to String' will scan to the end of the string if the pattern is not found. The test state is set to true if any characters were scanned. Technically the statement is 'Scan Up to String or End of String'. The entire string will be in the 'result' and the 'remainder' will be empty.
The following will work:
Scan up to string "Traditional" (case insensitive) in field Composer, result to Variable 15 remainder to Variable 14. Set state
Scan string "Traditional" (case insensitive) in field Variable 14 (ignore SP), result to Variable 9 remainder to Variable 10. Set state
Basically you want to ignore the action test state after the first Scanner statement. It will return true unless the Composer field was empty or started with Traditional. ie.'no characters were scanned'.
With the above two lines, the action test state will be true if and only if Traditional was found anywhere in Composer.
Variable 15 will be empty or will contain all text before Traditional
Variable 14 will be empty or will contain all text after Traditional
Variable 9 will be empty or will contain Traditional
Variable 10 will be empty or will contain all text after Traditional
I guess I have to be a little more verbose in the documentation....sigh 🙁
I can't tell what you actually have in the Composer field when Traditional is present. However, if the word is consistently delimited you can easily remove any 'item' containing Traditional and place it at the start of the list. For example if the composer list is delimited by the multi-value delimiter.
Test if the list in field Composer delimiter "\m" has an item containing case insensitive "Traditional", remove, item->V15
if true
Add "\v15" to the start of the list in field Composer delimiter "\m"
endif
The assumption is that the above code is being run 'groupwise'.
REMEMBER that the mailer strips backslash characters. The code may not make any sense if viewed in an email.
|