1c 7.7 in the document cell add a calculator. Using the clipboard as a numeric cell

When performing simple current calculations in the 1C: Enterprise 8.0 system, you can use the built-in calculator. You can call it on the screen by selecting the "Service" - "Calculator" item, or by using the button
located in the form of a calculator, resize in proportion to the resizing of the window.
The calculator allows you to perform all arithmetic operations, calculate percentages and reciprocal values, store numbers in the buffer, and perform addition and subtraction with the values ​​stored in the buffer. When entering a number, you can edit the entered value by deleting the incorrectly entered digits.
You can use both a mouse and a keyboard to work with the calculator.
If the result of any operation exceeds the permissible digit capacity of the calculator, a message will be displayed: "The result exceeds the permissible limits."
When divided by 0, the display will show the message: "Division by 0". To continue working in this case, you will need to clear the calculator display by pressing the reset button "C".
The last 15 calculations are stored in the calculator's memory,
which can be viewed using the button
-
located to the right of the display.
The calculator has 10 memory registers for storing numbers and their further use in calculations. Using the buttons "MS", "M +", "M-" and "MS" work with the first register.
To memorize the result of calculations in the first register, press the "MS" button. The memorized value will appear in the display to the right of the inscription "M =". By pressing the "MR" button, the memorized value is displayed from the first register. By pressing the "M +" button, the value stored in the first register is added to the result
calculations, using the "M-" button, the value stored in the first register is subtracted from the calculation result. The MC button resets the contents of the first register.
To memorize a number in one of the other nine registers, type the number on the display (enter or make the necessary calculations) and
press the j button
To extract a number from the register, press the button
located next to the "MS" button. A list of registers will be displayed. Specify the required register with the mouse. The number is recorded.
located next to the buttons "MR", "M +" or "M-", depending on the type of action, and select the register. The register is cleared in the same way ("MC" button).
The calculator can work in several modes. Mode selection
by button>
and choosing the desired item:
In the "Microcalculator" mode, all actions are performed from the keyboard. In this case, the calculator takes on a simplified form: Numbers are entered from the keyboard. To clear the display, use the "C" key.
In the "Formula calculator" mode, all actions are recorded in the scoreboard sequentially. To organize a certain sequence of actions and enter complex expressions, it is allowed to use brackets: Calculator X І0Ш 25 + 578) "4+ (547 + 55)" 5) L7 | ? - MS t М = о MR - 7 8 9 1 / x g 1 М + "4] | 5 Є І к і L 1 m-" ПІ 2 3І Lci - YUSHISH - -
In the "Settings" mode, you can adjust the accuracy of the calculator's calculations. In the displayed setup dialog box, specify the number of decimal places:
The calculator can be used not only to perform calculations, but also to enter numerical details in documents and directories. To do this, to the right of the numeric variable, click the button

People who are going to become a programmer in any programming language are forced to master the specialty, first from theory, then from the simplest programming examples. One of the simplest examples, we can say the start in programming in all languages, is writing a calculator. For this, we decided to write a tutorial on how to write a calculator in 1C language.
We will develop a simple calculator with simple arithmetic functions: addition, subtraction, multiplication, division. The calculator does not take into account more complex operations such as: root, percent, memory. If you wish, you can improve our example yourself.
Any programming assignment starts with a development plan. Make a plan for yourself. Imagine how you would write a calculator? What is the algorithm of actions needed? What tools will be needed to reproduce this or that operation, even without translating them into the program language. Your purely intuitive intentions.

Exercise: Calculator for 1C 8.2, a common application.

"Chips" of the task:

1. The calculator board must be a line, because it is to a line that symbols can be assigned.
2. The calculator must have a buffer (storage location) of the first number, so that after entering the second number in the calculator's display, the first number can be retrieved from the buffer and performed with arithmetic operations.
3. Any arithmetic operation must be assigned a value to a variable, then so that when you press "equals" the program understands what operation it should perform: subtract, divide or multiply.

Practical implementation:

1. In the configurator, create external processing through the menu File - New - External processing.
2. We create a processing form. Just create an empty shape and click Finish.
3. Add the following details to processing
a) calculator display - type - string, length - 15
b) operation - arbitrary
c) buffer - type - number, length -10, precision - 2.
Why these details are needed will become clear a little later.

4. Add elements to the processing form: buttons, an input field. The buttons that can be added to the form are located at the bottom of the configurator on the "Controls" control panel. You need to add the following elements:
- A string titled "Scoreboard Calculator". Place it at the very top of the form.
- Number buttons from 1 to 9 plus button 0. And also buttons denoting arithmetic operations: addition, multiplication, difference, division.
Name the number buttons: Number1, Number2 ... Number0.
Arithmetic buttons: Addition, Multiplication, Difference, Division.
To display numbers and symbols of arithmetic operations in the property of each button instead of the names of buttons on the form, write in the "Title" field the corresponding numbers and symbols of operations: "1", "2", "3", ... "*", "-" ...
The location of the numeric and arithmetic buttons on the form is not important. You can arrange them in any order and place you want.
5. We create a handler for clicking on numbers. We stand on the "Number1" button, open its property and at the very end we find a list of possible events for this button. There is only one "Press" event available, and it is still empty. Click on the magnifying glass and the processing module automatically displays the code generated by the program. We have just created a template for the procedure that will be executed when you click on the "Number1" button.


We write the code:

Procedure Digit1 Press (Element)

OutputNumbers1 = 1;
Calculator Board = Calculator Board + Lion (OutputNumbers1, 9);
Calculator Scoreboard = Number (Right (Calculator Scoreboard, 10));

End of Procedure

Comments to the code: a) We say that the "Digit1" button is digit 1. b) We say that the calculator display works by adding a character to the previous character (on the left) c) We convert the characters entered into a string into a number. For the remaining nine digits, we create exactly the same procedures with the same code. The last button on the calculator form will be the "Clear" button [C]. Her principle is simple - she writes zero in the calculator scoreboard. Those. resets the scoreboard.

6. Arithmetic operations. Create for each button a designation arithmetic operation pressing procedures. In the same way as we have already created for the buttons denoting numbers. In the code of each button, write the code:

Procedure Collapse Press (Element)
Buffer = Number (Scoreboard);
Calculator Scoreboard = "";
Operation = "Addition";
End of Procedure

I'll tell you about a very curious technique.

Once an accountant came to me and asked me: is it possible to somehow quickly calculate the sum of all documents in the implementation log for the 1st quarter of 2013?

I thought a little and did it like this:

1. I went to the magazine "Implementation (acts, invoices)" and set the required period:

Important! At the same time, note that one of the numbers is highlighted in a darker color, since I left-clicked on it before selecting the lines. it important point, since then 1C will summarize the selected lines exactly by the column with the selected value.

3. Finally, I pressed a letter M in the title of the 1C: Enterprise window:

5. And he told the surprised accountant the result:

The sum of all selected documents in this period was 8,746,995.

And you can do exactly the same in any magazines with any numerical columns (amount, quantity, etc.).

In addition, you can select not all documents, but only the necessary ones using the following technique:

  • hold down the Ctrl key on your keyboard.
  • select (or unselect) the required lines with the left mouse button, but remember: you need to click on the lines only within the column that you are going to summarize.

The same technique can be applied to any tabular section.

Here is a short trick that will allow you to work wonders in some cases.

1C: Enterprise 8.0. Universal self-instruction book Boyko Elvira Viktorovna

11.1. Calculator

11.1. Calculator

When performing simple current calculations in the 1C: Enterprise 8.0 system, you can use the built-in calculator. You can call it on the screen by selecting the item "Service - Calculator", or using the button

toolbar of the program.

The calculator can be dragged anywhere on the screen and the window can be resized. In this case, all controls located in the form of a calculator change their size in proportion to the resizing of the window.

The calculator allows you to perform all arithmetic operations, calculate percentages and reciprocal values, store numbers in the buffer, and perform addition and subtraction with the values ​​stored in the buffer. When entering a number, you can edit the entered value by deleting the incorrectly entered digits.

You can use both a mouse and a keyboard to work with the calculator.

If the result of any operation exceeds the permissible digit capacity of the calculator, a message will be displayed: "The result exceeds the permissible limits."

When divided by 0, the display will show the message: "Division by 0". To continue working in this case, you will need to clear the calculator display by pressing the reset button "WITH".

The last 15 calculations are stored in the calculator's memory, which can be viewed using the button

located to the right of the display.

The calculator has 10 memory registers for storing numbers and their further use in calculations. Using the buttons "MS", "M +", "M-" and "MC" work with the first register.

To memorize the result of calculations in the first register, press the button "MS"... In the scoreboard, to the right of the inscription "M =", the memorized value appears. At the push of a button "MR" the stored value is displayed from the first register. By button "M +" the value stored in the first register is added to the result of calculations, by pressing the button "M-" the value stored in the first register is subtracted from the calculation result. Button "MC" resets the contents of the first register.

To memorize a number in one of the other nine registers, type the number on the display (enter or make the necessary calculations) and press the button

located next to the button "MS"... A list of registers will be displayed. Specify the required register with the mouse. The number is recorded.

To extract a number from the register, press the button

located next to the buttons "MR", "M +" or "M-", depending on the type of action, and select the case. The register is cleared in the same way (button "MC").

The calculator can work in several modes. The choice of the mode is carried out by the button

and choosing the desired item:

In the mode "Microcalculator" all actions are performed from the keyboard. In this case, the calculator takes a simplified form:

The numbers are entered from the keyboard. Use the key to clear the display. "WITH".

In the mode "Formula calculator" all actions are recorded in the scoreboard sequentially. To organize a certain sequence of actions and enter complex expressions, the use of parentheses is allowed:

In the "Settings" mode, you can adjust the accuracy of the calculator's calculations. In the displayed setup dialog box, specify the number of decimal places:

The calculator can be used not only to perform calculations, but also to enter numerical details in documents and directories. To do this, to the right of the numeric variable, click the button

or use the key F4.