- Регистрация
- 16.03.2013
- Сообщения
- 231
- Благодарностей
- 36
- Баллы
- 28
Hi guys i'm trying to figure out how this snippet works, is it still up to date? Because i'm trying for the last 2 hours to get it running.
Basically i need to check if a Dealer is in my list already or not. If it's there, stop the action ,if it isn't continue with the template.
Basically i need to check if a Dealer is in my list already or not. If it's there, stop the action ,if it isn't continue with the template.
Код:
// take search text from variable
var textContains = project.Variables["DealerName"].Value;
// get a list or search
var sourceList = project.Lists["Dealeri"];
// search in each line of list
lock(SyncObjects.ListSyncer)
{
for(int i=0; i < sourceList.Count; i++)
{
// get line from list
var str = sourceList[i];
// check if line contains text, if there are matches return "yes"
if (str.Contains(textContains))
return "yes";
}
}
// ifnothing found return "no"
return "no";