S
S
Sergey Grigorov2018-08-05 14:49:30
1C
Sergey Grigorov, 2018-08-05 14:49:30

Reflection in 1C?

Hello. I would like to know - is there a reflection in 1C as such? There is no information anywhere.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kinash, 2018-08-05
@Serjio-Grig

Hello. Yes, there is reflection. I do not agree - the information is there.
The question is rather: what are you specifically interested in from the toolkit of reflective programming (metaprogramming)?
As stratosmi correctly said above - there is a generation by type name. Those. you can easily traverse the types of the entire metamodel, select descriptions with the desired characteristics and create instances of them.
You can also modify the executable code. You can programmatically generate arbitrary code, and then execute it yourself. The same applies to the reporting system - it is not necessary to have pre-prepared data requests and an output form layout - all this can be generated on the fly as a reaction to the incoming data and as part of interactive work with the user.
Is that all you're interested in? The syntax with two asterisks, as it were, hints at an array reference. The fact that you can pass any number of arguments later in the call process is like python syntactic sugar. In 1C, this is implemented only in the predefined constructor of the Structure object. In all user methods, the number of arguments is strictly limited to the declared ones. If it is necessary to use an unknown number of arguments in advance, it is required to use an array, structure, or correspondence in the declaration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question