While Loop checking multiple words - VisualCron - Forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


kgilreath
4 years ago
I have a while loop that checks a string variable for the word 'Success'. I'd like for the loop to check for words 'Success' or 'Warning. Is there syntax that allows to check multiple words?

image.png
Sponsor
Forum information
Gary_W
4 years ago
You could use Thomas' StringContains function from the task repository once you download it:

{TASKREPOSITORY(d6ca5c3b-02bc-432e-8438-fa8006fe79dd|StringContains(Success(String);Success:Failure(String);:(String))|)}

From the help:
Returns true if string contains search string. Multiple searchstrings allowed

haystack: The string to be searched
needles: A string with characters that should be searched for. Separated by delimiter
delimiter: The delimiter used in needles

Example:
haystack = abcde
needle = x;d
delimiter = ;

Searches string abcde for x or d. Returns true


Be advised though this function will return True if the word is also part of a word, i.e. "Successful" as the haystack in my example will also return True.

kgilreath
4 years ago
Thanks, I'll check that out!
kgilreath
4 years ago
That function worked perfectly, thanks again!
Support
4 years ago
Originally Posted by: kgilreath 

That function worked perfectly, thanks again!



Glad you got it working!
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
Scroll to Top