Desktop version

Main > Forum > 1C:Enterprise Platform > Studying 1C:Enterprise platform > What is a Correct Method to find out if there is a Key in the Structure?

Forum

Search UsersRules
What is a Correct Method to find out if there is a Key in the Structure?
#1
Active user
Points:: 3
Joined:: Sep 16, 2011

Please answer how to find out if there is a key in the structure? I’m trying the following code:

Code
Try
    Value = MyStructure.StructureKey;
Except
    Value = Undefined;
EndTry;

But it always breaks on an error at that place if I use Stop on Errors in Debugger. Is there a correct way of doing this?

Profile
#2
Active user
Points:: 32
Joined:: Sep 16, 2011

Use the following:

Code
If MyStructure.Property("StructureKey") Then
    // Your code here
EndIf;

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.