List bug

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
List line is returning not line but splitted already and not in right way.

Just example:
 

Вложения

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
csv is table, not a list.
try to use proper methods for tables.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Oh that's kinda offensive :db:

Код:
var masterList = project.Lists["Master"];
string data = masterList.ElementAt(0);
return siteNr = Macros.TextProcessing.Split(data, ",", "2").First();
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Oh that's kinda offensive :db:

Код:
var masterList = project.Lists["Master"];
string data = masterList.ElementAt(0);
return siteNr = Macros.TextProcessing.Split(data, ",", "2").First();

No no no. I'm not there to offend somebody. :-) Just there is bug and I know it, but again this is some weird bug. Let me show you what I'm getting.



This is piece of code: and this is what I can see in logs:


In some reason it does not return string, but all data is returner like in list and without comas. I'm more than sure that there is some mistake because there was changed something in table settings, for csv files...

About this:

string data = masterList.ElementAt(0);
string data = masterList[0];

This is that same :-)
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Код:
// Save all data by sites
var masterList = project.Lists["Master"];
if(masterList.Count == 0)
{
    project.SendInfoToLog("Links prepared", true);
    return true;
}
string data = masterList[0];
project.SendInfoToLog(data, true);
return Macros.TextProcessing.Split(data, ",", "2").First();
this works in unreleased build
http://i.gyazo.com/2a68a0119abb267dd8ff664dd1b5cd00.png
 

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