Perform the CSharp OwnCode Input string was not in a correct format.

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
11
Баллы
18
I have 300 lines of code in a c# code box playing in Project Maker. The code includes a loop and sometimes, apparently without reason, it stops and throws this error.

Код:
Perform the CSharp OwnCode  Input string was not in a correct format.
It doesn't say the line number so how can I tell where is the problem?

The code is not relevant here as this happened on different occasions with different codes. So how can I debug if I don't know where to look?
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 233
Благодарностей
5 846
Баллы
113
We won't be able to answer, unless you give code sample which throws the error.
 

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Благодарностей
11
Баллы
18
I don't really need you to debug this particular code as I find this issue in different occasions when building scripts and oftentimes I find the issue - what I need is how to find the exact line number where the errors occur.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 182
Баллы
113
@VladZen I agree to @zenfreak I have got same difficulties with this error. And only way to debug when You get this error is put in Your code many project.SendInfoTolog and try to see which string in all code makes that error.
It is easy to find problem in 50 lines of code, but if there is 200+ lines with many text processing logic's then to find bug is nightmare

UPD:

And another such error is "Sequence contains no elements" also does not give You line of error.
This you can get easy:
C#:
string textToSplit = @"firstPart;SecondPart";
Macros.TextProcessing.Split(textToSplit, @";", "2").First();
Thanks
 

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