help me implement this code

bill

Client
Регистрация
05.07.2014
Сообщения
355
Благодарностей
9
Баллы
18
hi im using zenno demo and i want to use the code provided by darkdiver, but i don't know the first thing about this stuff. I have built a chat bot that i want to check the current users number against a list of numbers. i put the file locations in ["tableSearchTextContains"] and ["SourceTable"] as "C:\lists\1.txt" and "C:\lists\2.txt" to which i get Unrecognized escape sequence. can somebody explain to me what I need to do?

Код:
// take text for search from a variable
var textContains = project.Variables["tableSearchTextContains"].Value;
// get table for search
var sourceTable = project.Tables["SourceTable"];
// search in each row
lock(SyncObjects.TableSyncer)
{
    for(int i=0; i < sourceTable.RowCount; i++)
    {
        // read a row (array of cells)
        var cells = sourceTable.GetRow(i).ToArray();
        // loop through all cells
        for (int j=0; j < cells.Length; j++)
        {
            // check if cell contains specified text, if there are matches return "yes"
            if (cells[j].Contains(textContains))
                return "yes";
        }
    }
}
// if nothing found return "no"
return "no";
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Maybe this will help you a little.
 

Вложения

  • Спасибо
Реакции: bill

bill

Client
Регистрация
05.07.2014
Сообщения
355
Благодарностей
9
Баллы
18
thank you! that helped... now I'm having problems with the result variable. I figure this is basic stuff and im just missing the obvious here... but i redirect my own #C action to a logic if action and put "yes" in it. When i run debug I get "Run logic IF-statement result: " then "alert action not executed"

can anyone point me in the right direction? i'm trying to get it to read the yes/no output of the #C code then proceed to the next action based on the response. I thought the logic action would do it.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
I think example is needed )
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
I've added IF...
 

Вложения

  • Спасибо
Реакции: bill

bill

Client
Регистрация
05.07.2014
Сообщения
355
Благодарностей
9
Баллы
18
thanks AGAIN :-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)