Смотрите видео ниже, чтобы узнать, как установить наш сайт в качестве веб-приложения на домашнем экране.
Примечание: Эта возможность может быть недоступна в некоторых браузерах.
Вы используете устаревший браузер. Этот и другие сайты могут отображаться в нём некорректно. Вам необходимо обновить браузер или попробовать использовать другой.
But unfortunately, I'm quite sure set it to null is not the same from remove a variable.
Unless the code below is wrong, change a variable to null just changes its value null. Don't remove the variable. To remove, you will have to manually remove it from the project.
var gbVar = project.GlobalVariables["namespace", "globVar1"];
If the variable exists, the code will return true
If the variable do not exist, this code will raise an error.
Set the variable to null, in case it exists, won't change the above behavior. The variable will, still, exist in memory.
Why that was important to me:
If you are using that as a flag for threads in zennoposter, only the first time you run it you will know who the first thread is, because the above code will raise an error. So, after get the first thread you create the variable to the remains threads. They won't raise errors and you will know they aren't the first thread.
If you run it again you won't know who the first thread is, since the variable is already created and you can't remove it from memory with code, only if you delete the project from the poster manager or restart zennoposter
It took me days trying all kind of solutions to overcome that. Then I realized that Globals are very unhandy and unstable. For me, it's better to sync important parts of the code with files.
But unfortunately, I'm quite sure set it to null is not the same from remove a variable.
Unless the code below is wrong, change a variable to null just changes its value null. Don't remove the variable. To remove, you will have to manually remove it from the project.
var gbVar = project.GlobalVariables["namespace", "globVar1"];
If the variable exists, the code will return true
If the variable do not exist, this code will raise an error.
Set the variable to null, in case it exists, won't change the above behavior. The variable will, still, exist in memory.
Why that was important to me:
If you are using that as a flag for threads in zennoposter, only the first time you run it you will know who the first thread is, because the above code will raise an error. So, after get the first thread you create the variable to the remains threads. They won't raise errors and you will know they aren't the first thread.
If you run it again you won't know who the first thread is, since the variable is already created and you can't remove it from memory with code, only if you delete the project from the poster manager or restart zennoposter
It took me days trying all kind of solutions to overcome that. Then I realized that Globals are very unhandy and unstable. For me, it's better to sync important parts of the code with files.
The problem is, that you don,t know what of threads is last.
So, if you want use global vars, you can use one that will contains count of runing threads, each thread in start increase it by 1, and decreased when end.
if var is null or 0, we have no threads running, so it,s new run.
I didn't do that because I was debugging and interrupting the poster at random moments. I was afraid about, in any of these interrupts, not allow the zennoposter to decrease the value. I'm not sure if, when you interrupt the script, the poster let the script reach at the BadEnd before the interruption. Got me?
So, end up using a pid file.
But that is a great solution once you don't need to touch the development anymore.
I didn't do that because I was debugging and interrupting the poster at random moments. I was afraid about, in any of these interrupts, not allow the zennoposter to decrease the value. I'm not sure if, when you interrupt the script, the poster let the script reach at the BadEnd before the interruption. Got me?
So, end up using a pid file.
But that is a great solution once you don't need to touch the development anymore.
Yes, when you break project, variable not decrease, so you can create one little project, that would reset it, and run this project after debug/breaking.
Or use files (think it,s more simple)