This Sample isn't work:
Code: Select all
struct TestStruct{
string Name;
TestStruct(string _Name){
Name=_Name;
DebugTN("TestStruct",Name);
//Тест обработчика событий в классах
if(dpConnectUserData("OnTestStruct",this,true,"Debug_ServerSOU")){
DebugTN("TestStruct",getLastError());
}
if(dpConnect(this,"OnTest",true,"Debug_ServerSOU")){
DebugTN("TestStruct",getLastError());
}
}
void OnTest(string dp,anytype value){
DebugTN("OnTest",Name);
}
};
void OnTestStruct(TestStruct me,string dp,anytype value){
DebugTN("OnTestStruct",me.Name);
}
global TestStruct TestStructG = new TestStruct("TestStructG");
main(mapping event)
{
{
TestStruct TestStructL = new TestStruct("TestStructL");
return;
}
}
Log output:
WCCOAui1:2020.04.22 09:24:04.853["TestStruct"]["TestStructG"]
WCCOAui1:2020.04.22 09:24:04.853["TestStruct"]["TestStructL"]