How to access variable when in step2.cs from step1.cs?

kvdd

Client
Регистрация
05.05.2011
Сообщения
37
Благодарностей
0
Баллы
6
Hello,

I have opened two websites, so CodeCreator creates two steps. In step1.cs I have two variables an var id and a var keyword. How can I access these from step2.cs?

I have understandig in PHP and C# but my OOP level is novice :-)

Thanks!
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
831
Баллы
113
JavaScript:
//step1
namespace NewProject
{
	
	internal class Step1
	{
		public static int ar;
		public static int Execute(Instance instance)
		{
                      blah blah blah;
		}
	}
}

//step2
namespace NewProject
{
	internal class Step2
	{
		public static int Execute(Instance instance)
		{
			Step1.ar=5;
		}
	}
}
 
  • Спасибо
Реакции: kvdd

kvdd

Client
Регистрация
05.05.2011
Сообщения
37
Благодарностей
0
Баллы
6
You are my todays true hero :D
Now I see this, I say to myself: "Ofcourse use public for accessing and static for remembering the var!"

Ai ai, but you get many thanks!!
 

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