1c Declension of position by case. Declension name. Service "Declination by cases"

Declension of full name in 1C 8.3

During the operation of the 1C software complex, users often have questions regarding the 1C 8.3 full name declination. 1C function of declination of full name is carried out by a special component, which is called “NameDecl.dll”. To start using the component, you need to copy it from the information and technical support disk to the folder where the main bin platform is located, and also register it in the operating system. Copying is carried out using the command “resvr32 NameDecl.dll”. To do this, open “Start” and call the “Run” directive, as shown in the figure.

Open a window and enter “resvr32.exe”, indicating the path to the required library. The library is selected using the “Browse” button. Next, you need to select “OK” and confirm the library registration.

1c declination of full name is performed according to 2 parameters:

  • Case, type - number. This is a required parameter.
  • Full name, type - string. This is also a required parameter.

Since there are six cases in the Russian language, a case is assigned a number from 1 to 6 according to the table below:

A third, optional parameter is also identified for the declination component of Full Name 1C - gender (type - number). There are 3 options here: 0 - auto, 1 - male, 2 - female.

Service 1C 8 declension full name

Programs version 1C 8.3 have a special service for declension of full name by cases 1C 8.3, which works through the configurator. Therefore, to decline your full name, open the configurator window and use the “Decline” function, as shown below:

We enter the details from the directory, where they are displayed in the nominative case. Documents are printed and displayed in forms in the desired declension. As an example, this is what it looks like in the contract form:



As an example, below is a hiring order, where in the specialist’s cards his last name, first name and patronymic are written in I.P., but in printed form they are displayed in R.P.

1C automatically makes it possible to create printed forms and documentation taking into account current legal requirements. The need for declination by cases, gender and numbers is dictated by the standards of business document management, according to which any document is drawn up aesthetically, competently and corresponds to the status of the company.

Using the autodecline function minimizes the likelihood of errors when generating documents, which protects against negative consequences in the future. This is especially true for those cases when it is formed immediately large number documents. Autodeclension streamlines work with documentation and saves time, which has a positive effect on productivity.

We have analyzed 2 methods of declination of a surname, a patronymic name by cases, numbers and genders - using a special component for declination of Full Name 1C 8.3 and through the configurator service. Try both and see which one works best for you.

The file contains procedures for 7.7 and 8.x. A string in the format Last Name First Name Patronymic is passed to the procedure.

UPD 11/26/10: with gratitude - new version functions. I haven't tested it! Questions about the operation of this version should be directed to him; for some reason he doesn’t want to post them :)

Function CaseFull Name (Full Name Value, Case = 1, Initials Only = False, Separator Value = ".")
If TypeValue(full name)<>Type("String") Then
Report("Invalid line sent to ""case of full name!"""); Return full name;
endIf;

// remove multiple spaces
While 1=1 Cycle
Full name=ScrLP(StrReplace(full name," "," "));
If Find(full name," ")=0 Then Abort EndIf;
EndCycle;

If TypeValue(Case)=Type("String") Then
pad=ScrLP(NReg(Lev(Case,1)));
If Find("irdvtp",pad)=0 Then

endIf;
OtherwiseIf TypeValue(Case)=Type("Number") Then
If (Case<1) или (Падеж>6) Then
Report("Incorrect case transferred to ""full name case""!"); Return full name;
endIf;
pad=case-1;
endIf;

Full name=ScrLP(NReg(full name)); // this is more convenient

// your composition analyzer
Last name="";
For th=1 By StrLength(full name) Cycle
symbols=Avg(full name, th, 1);

LastName=LastName+character;
EndCycle;
ы=й+1; // passed space
Name="";

symbols=Avg(full name, th, 1);
If symbols=" " Then Abort EndIf;
Name=Name+character;
EndCycle;
ы=й+1; // passed the second space
Middle name="";
For y=y By StrLength(full name) Cycle
symbols=Avg(full name, th, 1);
If symbols=" " Then Abort EndIf;
Middle name=Middle name+symbol;
EndCycle;

// now we have separate Last Name, First Name and Patronymic.
// the actual block for analyzing content and cases begins

// return if itself is nominative. If the return OnlyInitials is set, then convert to initials
If (Lev(Case,1)="I") or (Case=1) Then
If NOT OnlyInitials or Find(Full Name, ".") Then
Return full name; // either the string is already converted or there is no need to convert
endIf;
NewFull Name = TRreg(Last Name) + " " + Vreg(Lev(First Name, 1)) + pSeparator + Vreg(Lev(Middle Name, 1)) + pSeparator;
Return Abbreviation(New Full Name); // in case the delimiter is a space. We'll cut off the last one
endIf;

// analyze the gender M/F
If Right(Middle name,1)="a" Then Gender="F" Otherwise Gender="M" EndIf;

// create a table structure that stores the endings of words
current=NewValueTable;
RowType=NewTypeDescription("String", NewStringQualifiers(3));
NumberType=NewTypeDescription("Number", NewNumberQualifiers(1,0));
current.Columns.Add("StarOk",RowType); // old ending 2 characters
// columns storing new word endings
current.Columns.Add("p"); // parent
current.Columns.Add("d"); // dative
current.Columns.Add("to"); // accusative
current.Columns.Add("t"); // instrumental
current.Columns.Add("p"); // prepositional
// to indicate how many letters from the end of the word to cut off,
current.Columns.Add("NumberSlice",NumberType); // number of letters to be cut off

Vowels="aeeouiiiyyay"; // list of vowels as a string

// ======== process the last name ==========
// fill the table with data for the last name

If gender="M" Then
string=current.Add(); // Ivanov
line.StarOk="*s";

lines.NumberSlice=0;

String=current.Add(); // Krasinski
line.StarOk="*th";
string.p="wow"; string.d="om"; string.v="go"; string.t="im"; string.p="om";
lines.NumberSlice=2;

String=current.Add(); // almighty
line.StarOk="shiny";
string.r="him"; string.d="him"; string.v="his"; string.t="im"; string.p="eat";
lines.NumberSlice=2;

String=current.Add(); // white
line.StarOk="th";
string.p="wow"; string.d="om"; string.v="go"; string.t="th"; string.p="om";
lines.NumberSlice=2;

String=current.Add(); //paley
line.StarOk="*th";

lines.NumberSlice=1;

String=current.Add(); // rabinovich
line.StarOk="*h";

lines.NumberSlice=0;

String=current.Add(); // fix, slick
line.StarOk="*k";
string.p="ka"; string.d="ku"; string.v="ka"; string.t="com"; string.p="ke";
lines.NumberSlice=2;

String=current.Add(); // shinkar
line.StarOk="*ь";
string.p="i"; line.d="yu"; string.v="i"; string.t="em"; string.p="e";
lines.NumberSlice=1;

String=current.Add(); // perelman, oganesyan
line.StarOk="*n";

lines.NumberSlice=0;

String=current.Add(); // barankin
line.StarOk="in";
string.p="a"; string.d="y"; string.v="a"; string.t="th"; string.p="e";
lines.NumberSlice=0;

OtherwiseIf Gender="F" Then
string=current.Add(); // Sklodovskaya
line.StarOk="aya";
string.p="oh"; string.d="oh"; line.v="y"; string.t="oh"; string.p="oh";
lines.NumberSlice=2;

String=current.Add(); // Ivanova
line.StarOk="*a";
string.p="oh"; string.d="oh"; string.v="u"; string.t="oh"; string.p="oh";
lines.NumberSlice=1;
endIf;


If not EmptyString(LastName) Then
pb=Right(LastName,3); count="StarOk"; // search for it
newLastName=LastName; // if nothing changes, it will be so
str=current.Find(pb,count);
If<>


Otherwise
// strictly not found by the last three characters, search by two characters only by the last
pb=Right(LastName,2);
str=current.Find(pb,count);
If<>Undefined Then
Basis=Lev(LastName,StrLength(LastName)-string.QuantitySlice);
newLastName=Base+AbbrLP(string[pad]);
Otherwise // if we didn’t find two, we look for one at a time
pb="*"+Right(pb,1);
str=current.Find(pb,count);
If<>
Basis=Lev(LastName,StrLength(LastName)-string.QuantitySlice);
newLastName=Base+AbbrLP(string[pad]);


str=current.Find(pb,count);
If<>Undefined Then // found by type
Basis=Lev(LastName,StrLength(LastName)-string.QuantitySlice);
newLastName=Base+AbbrLP(string[pad]);
endIf;
endIf;
endIf;
endIf;
Otherwise
newLastName="";
endIf;

// ======== process the name ==========
// fill the table with data for the name
current.Clear();

If Gender="M" Then
// handle exceptions
If Name="lion" Then Name="lion" EndIf;
If Name="paul" Then Name="paul" EndIf;

String=current.Add(); // Sergey
string.starok="*th";
string.p="i"; line.d="yu"; string.v="i"; string.t="em"; string.p="e";
line.barcut=1;

String=current.Add(); // ivan + lion + paul
string.starok="*s";
string.p="a"; string.d="y"; string.v="a"; string.t="om"; string.p="e";
line.columncut=0;

String=current.Add(); // nikita
string.starok="*a";

line.barcut=1;

String=current.Add(); // onions
string.starok="ka";

line.barcut=1;

String=current.Add(); // Jeremiah
string.starok="iya";

line.barcut=1;

String=current.Add(); // ilya
string.starok="*i";

line.barcut=1;

String=current.Add(); // igor
string.starok="*ь";
string.p="i"; line.d="yu"; string.v="i"; string.t="em"; string.p="e";
line.barcut=1;

OtherwiseIf Gender="F" Then
// handle exceptions
//If Name="olga" Then Name="olg" EndIf;

String=current.Add(); // Irina
string.starok="*a";
string.p="s"; line.d="e"; string.v="u"; string.t="oh"; string.p="e";
line.barcut=1;

String=current.Add(); // Inga, Olga
string.starok="ha";
string.p="and"; line.d="e"; string.v="u"; string.t="oh"; string.p="e";
line.barcut=1;

String=current.Add(); // esther
string.starok="*ь";
string.p="and"; string.d="and"; line.v="b"; string.t="ju"; string.p="and";
line.barcut=1;

String=current.Add(); // Maria
string.starok="iya";
string.p="and"; string.d="and"; line.v="yu"; string.t="ey"; string.p="and";
line.barcut=1;

String=current.Add(); // sophia
string.starok="*i";
string.p="and"; line.d="e"; line.v="yu"; string.t="ey"; string.p="e";
line.barcut=1;
endIf;

// table is full. count the last 2 letters and look for them
If not EmptyString(Name) Then
pb=Right(Name,2); count="StarOk"; // search for it
newName=Name; // if nothing changes, it will be so
str=current.Find(pb,count);
If<>Undefined Then // found strict immediately


Otherwise // strictly not found, search only by the last one
pb="*"+Right(pb,1);
str=current.Find(pb,count);
If<>Undefined Then // found using the last one
Base=Left(Name,StrLength(Name)-string.QuantitySlice);
newName=Base+ScrLP(string[pad]);
Otherwise // we didn’t find the last one, we look for the type of letter
pb="*"+?(Find(Vowels,Right(pb,1))=0,"s","g");
str=current.Find(pb,count);
If<>Undefined=1 Then // found by type
Base=Left(Name,StrLength(Name)-string.QuantitySlice);
newName=Base+ScrLP(string[pad]);
endIf;
endIf;
endIf;
Otherwise
newName="";
endIf;

// ======== let's process the middle name, it's easier here ==========
current.Clear();

If Gender="M" Then
string=current.Add();
string.p="a"; string.d="y"; string.v="a"; string.t="em"; string.p="e";
line.columncut=0;
OtherwiseIf Gender="F" Then
string=current.Add();
string.p="s"; line.d="e"; string.v="u"; string.t="oh"; string.p="e";
line.barcut=1;
endIf;
If not EmptyString(Middle name) Then
Base=Lev(Middle name,StrLength(Middle name)-current.QuantitySlice);
new Patronymic = Base + AbbrLP(current[pad]);
Otherwise
new Patronymic="";
endIf;

If Only Initials Then
newName=Lev(newName,1); new Patronymic = Leo (new Patronymic, 1);
endIf;

// set the first letters to uppercase
newLastName=ВReg(Lev(newLastName,1))+Avd(newLastName,2);
newName=ВReg(Lev(newName,1))+Average(newName,2);
new Patronymic = VReg(Lev(new Patronymic, 1))+Avg(new Patronymic, 2);

// and now everything is together
If Initials Only Then // if the initials format is specified
new Full Name = new Last Name + " " + new First Name + n Separator + new Patronymic + n Separator;
Otherwise
new Full Name = new Last Name + " " + new First Name + " " + new Patronymic;
endIf;

If Find(Full Name, ".") Then // In case the input parameter is Last Name with initials. We don't touch the initials
new Full Name = new Last Name + " " + Treg(First Name) + Treg(Middle Name);
endIf;

Return Abbreviation(new full name);
EndFunction

When working in 1C, the user is faced with the issue of declension of the surname or position of an employee in printed forms of documents, that is, with a situation when it is necessary to declension of surnames by case.

For declination of a full name in 1C programs, an external component is provided - NameDecl.dll, which contains the declination function. You can take it from the ITS disk and copy it to the folder with the installed 1C platform - bin, register it in the operating system. This procedure is performed using the resvr32 NameDecl.dll command (under an administrator account). To do this, you need to call the “Run” command through the “Start” button, using the search or the Windows + R key combination.

Fig.1 Search window. Finding the Run command

In the window that appears, enter the command resvr32.exe and specify the path to the library to be connected using the “Browse” button.


Fig.2 “Run” command window

After clicking “Ok”, a message will appear stating that the library has been successfully registered.


Fig.3 Message window

Description of the declination method in 1C

Decline (full name, case, gender) according to the parameters:

  • Full name (required), type – string
  • Case (obligatory), type – number

The case in which the full name must be placed is specified by a number from 1 to 6.

Table of cases: questions, prepositions and their meanings in program code

It happens that an ambiguous situation arises when the program needs to determine the gender of a surname, for example, Sigida, Chepko, Sushko, Oganezyan, etc.

In this case, use an additional parameter:

  • Gender (optional), type - number

It shows whether to decline or not to decline the surname. In other cases, this parameter is omitted or the value 0 (“auto”) is used, because incorrect gender indication may affect the correct declination. Here the possible values ​​are: 0 – auto, 1 – male, 2 – female.

Service "Declination by cases"

1C 8.3 programs already include a service for declension of data of employees or contractors in accordance with the cases used in the document.



Fragment 1

#ProgramInterface Area // Declines the full name // Only works on Windows OS. // // Parameters: // Full name - Line - Line containing the full name for declination. // Case - Number - the case in which it is necessary to decline the representation of the object. // 1 - Nominative. // 2 - Genitive. // 3 - Dative. // 4 - Accusative. // 5 - Creative. // 6 - Prepositional. // Object - Declensions - Link to the object, the details of which are declined // Gender - Number - Number - gender of the physical lead, // 1 - male, // 2 - female. // // Return value: // String - The result of the declension of the full name in case. // Function DeclineFull Name(Full Name, Case, Object = Undetermined, Gender = Undefined) Export // Declines the representation of an object. Function DeclensionRepresentations(Representation, Case, Object = Undefined) Export // Performs actions on the form necessary to connect the Declension subsystem.

Fig.4 Configurator window



Fragment 2

// Declines the object's representation. Function DeclineRepresentation(Representation, Case, Object = Undefined) Export Return Decline(Representation, Case, Object); End of function // Performs with the form the actions necessary to connect the Declension subsystem Procedure When CreatedOnServer(Form, View, MainFormAttributeName = "Object") Export // Event handler When RecordedOnServer of a managed object form for declension Procedure When RecordedOnServer(Form, View, Object, ThisFullName = False , Gender = Undefined) Export // Sets the sign of availability of the declination service Procedure SetAvailability of Declension Service (Availability) Export SetPrivilegedMode (True); CurrentParameters = New Match(SessionParameters.ClientParametersOnServer); CurrentParameters.Insert("DeclinationServiceAvailable", Availability); SessionParameters.ClientParametersOnServer = New FixedCompliance(CurrentParameters); SetPrivilegedMode(False); End of Procedure

Fig.5 Using the “Slope” function

Using details in the document that are selected from the directory in which they are presented in the nominative case, they will be displayed in the printed form of the document with the required declension.

Let's look at the declination function using the example of a contract in 1C: Accounting 3.0. (1C:Enterprise 8.3). This provides for declination of name and position.



Fig.6 Contract form window. Setting up surname and position declination

The program will automatically put the correct option into the printed form.



Fig.7 Program window – “Declination by case”

An example of case declination can be seen in the “Order for Hiring”. On the employee's card, his full name is indicated in Nominative case, and in printed form - in the Genitive.



Fig. 8 Example of declination of full name in the printed form “Order for employment”

The 1C program, taking into account the requirements of legislation and standards, allows you to comply with the approved procedure for preparing documentation and generating printed forms.

Declension by cases is also due to business standards, which stipulate that any document must be drawn up not only competently, but also aesthetically competent, which reflects the status of the organization.

In addition, the use of functions in the program such as autodeclension significantly reduces the likelihood of errors in document preparation.

Related articles

  • Asmara Eritrea. St. Mary's Church

    Founded in the 12th century, Asmara was declared the capital of the country in 1884. Late 1800s Italy began the colonization of Eritrea, and soon a narrow-gauge railway was built connecting Asmara with the coast, which increased the status...

  • Who are the “crusaders”?

    Stories of knights loyal to the king, a beautiful lady and military duty have been inspiring men to exploits for many centuries, and people of art to creativity. Ulrich von Lichtenstein (1200-1278) Ulrich von Liechtenstein did not storm Jerusalem, did not...

  • Principles of Bible Interpretation (4 Golden Rules for Reading)

    Hello, brother Ivan! I had the same thing at first. But the more time I devoted to God: the ministry and His Word, the more understandable it became to me. I wrote about this in the chapter “The Bible Must Be Studyed” in my book “Returning to...

  • The Nutcracker and the Mouse King - E. Hoffmann

    The action takes place on the eve of Christmas. At Councilor Stahlbaum's house, everyone is preparing for the holiday, and the children Marie and Fritz are looking forward to gifts. They wonder what their godfather, the watchmaker and sorcerer Drosselmeyer, will give them this time. Among...

  • Rules of Russian spelling and punctuation (1956)

    The punctuation course of the new school is based on the intonation-grammatical principle, in contrast to the classical school, where intonation is practically not studied. Although the new technique uses classical formulations of the rules, they receive...

  • Kozhemyakins: father and son Kozhemyakins: father and son

    | Cadet creativity They looked death in the face | Cadet notes of Suvorov soldier N*** Hero of the Russian Federation Dmitry Sergeevich Kozhemyakin (1977-2000) That’s the guy he was. That’s how he remained in the hearts of the paratroopers. It was the end of April. I...