How to reset globvar to 0 with c# code?

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Using the attached code for the globvar.

I know how to increase and decrease by 1 but I want a seperate template so i can reset chosen templates to 0 without having to restart zp.

I was doing it with set variable and putting the globvar name. Ive done that in the past fine but today for some reaosn I got an error saying: Perform c sharp own code. Input string was not in correct format.

This error came after I used it not, on that process but on subsequent threads of the oroignal tmeplate I reset to 0.

I think I made some mistake somewhere since Ive used that way no problems before. I copy and pasted from another template and renamed so maybe that is the problem. but still would be nice to know the c# way to do it.

So how to do it with the attached c# code?
 

Вложения

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 242
Благодарностей
5 848
Баллы
113
Код:
project.GlobalVariables.SetVariable("MyNamespase", "ExistingVariableName", "");
 
  • Спасибо
Реакции: Harambulus

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Something is still messed up.

I use that code on one project; ran it in pm. Made sure the variable name was different but it still cleared the global variable of another different template which didnt have the same variable name.
 
Последнее редактирование:

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 242
Благодарностей
5 848
Баллы
113
Something is still messed up.

I use that code on one project; ran it in pm. Made sure the variable name was different but it still cleared the global variable of another different template which didnt have the same variable name.
You sure? the code works only within current project - project.GlobalVariables.SetVariable("MyNamespase", "ExistingVariableName", "");
 
Последнее редактирование:

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Yes I just checked it agian and it did it again.

As soon as I do it for the unrelated template the other one gives errors of c#owncode: input string was not in the correct format. and I have to restart to fix it.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 242
Благодарностей
5 848
Баллы
113
Yes I just checked it agian and it did it again.

As soon as I do it for the unrelated template the other one gives errors of c#owncode: input string was not in the correct format. and I have to restart to fix it.
Ok, now I understand you. It seems to be the bug with global variables... We will check it.
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Is there no workaround for this? because it totally holds things up.

I tried using the inbuilt set variables and adding the global variable but still it doesnt work. The thread gives the error tho the other ones dont seem to do it like with the c code.

I have like 15 threads going at ones alot using multithread so it is a real spanner in the works when i have to close down the whole poster. I have to wait a couple of hours till all threads finish and often otehr ones start on schedules so really is a nuisance.

EDIT- ok seems to work with built in globals using set variable.
 
Последнее редактирование:

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 242
Благодарностей
5 848
Баллы
113
Unfortunately, we could not reproduce the problem. Could you please attach templates which help to do it?
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Well its done it again.

I thought it was fixed but no.

Where do you want me to send?
 

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