What does row 1s mean? New functions of robots with rows. Function formatting StrTemplate()

There are few mechanisms for working with rows in 1C power supplies. First of all, the rows can be folded. In another way, you can take a row from a row. Thirdly, the rows can be aligned, following the template. The axis may be and everything that can be worked in rows.

Folding rows

To add rows to a row, use the “+” operation. You can only stack rows of lined rows.

VIBRATI "Name: " + Counterparties.Named YAK Column 1 Z Dovidnik.Counterparties YAK Counterparties DE Counterparties.Posilannya = &Posilannya

Function Adjustment

PIDSTRING(<Строка>, <НачальнаяПозиция>, <Длина>)

An analogue of the Sered () function in the object model. The Substring() function can be compressed into data of a row type and allows you to see a fragment <Строки> , which begins with a number symbol <НачальнаяПозиция> (symbols in a row are numbered 1) and dovzhina <Длина> characters. The result of calculating the function is a row type of changeable dowzhin, and the dowzhin is not interchangeable, since <Строка> May not be interchanged dovzhina that parameter <Длина> The constant is not 1024.

If the empty row is smaller, the lower one is set in another parameter, then the function turns empty row.

Respect! The use of the PIDSTROW() function to reduce the rows of the uncut line to the rows of the cut line is not recommended. Instead, it is better to use an operation of the type VIRASITI().

Function Similar

If you need to check that the row details meet the following criteria, we agree:

VIBRATI Counterparties.Name YAK Column 1 Z Dovidnik.Counterparties YAK Counterparties DE Counterparties.Name = "Gazprom"

Why is there a need for more cunning than leveling? Not just jealousy and nervousness, but similarity to a song template? The function itself is created for this purpose in a similar way.

CONFIRMATIVE - Operator for reversing a row to match the pattern. Analogous to LIKE in SQL.

The operator also allows you to equalize the value of the expression specified in the right hand. The mother row is significant. If the value of the expression satisfies the template, the result of the operator will be TRUE, otherwise it will be FALSE.

The corresponding symbols in the row of the template are service symbols and have a sense assigned to the symbol of the row:

  • % (in hundreds): sequence to accommodate as many characters as possible;
  • _ (chair): one additional character;
  • […] (the square arms have one or more symbols): any single symbol from the middle of the square arms. The re-arrangement may have narrower ranges, for example, a-z, which means the last symbol to be included in the range, including the ends of the range;
  • [^...] (in square arms there is a cross symbol, followed by one or more symbols): any single symbol, in addition to those listed after the cross symbol.

Any other symbol means itself and not an indispensable additional attraction. If you need to write down one of the listed symbols for yourself, then you can transfer<Спецсимвол>. Myself<Спецсимвол>(any special symbol) appears in the same operator after the keyword SPECIAL CHARACTER.

The “Row” type is common in all language programs. It’s interesting, and 1C has a lot of functions for working with it. In this article we will look at various methods of working with row types 1C 8.3 and 8.2 on stocks.

Row

In order to transform a change of any type into a row, there is a single function “Row()”. The input parameter will be the variable itself, the row representation of which will need to be eliminated.

Row (Bullshit) // Turns “Ni”
Row(12345) // rotate “12 345”
Row(LineDate()) //"07/21/2017 11:55:36″

It is possible to transform in order both primitive types and others, for example, elements of documents and documents.

SokrLP, SokrL, SokrP

The input parameters of these functions are changed to the row type. Functions display minor characters (spaces, carriage moves, etc.): from the left and right sides, only from the left side, and even from the right side.

Abbreviation("The gaps will be visible on both sides") // "The gaps will be visible on both sides"
Abbreviation("Problems will be visible on both sides") // "Problems of evil will be visible"
Abbreviation("Punches will be visible on both sides") // "Punches on the right hand will be visible"

Leo, Right, Seredovishche

These functions allow you to trim part of a row. The “Leo()” function rotates part of the row from the left side of the designated dove. The “Right()” function is similar, except that the cutting is done right-handed. The “Sed()” function allows you to specify the number of the symbol from which the row and row will be seen.

Leo (“Strokova Zminna”, 4) // Turns “Stro”
Right(“The line is changed”, 7) // rotates the “belt”
Seredovishche (“Strokova zminna”, 2, 5) // turns “troko”

LineLength

The function indicates the number of symbols that can be found in a row.

StrLength (“Word”) // The result of the wiki will be the number 5

Know

The function allows you to prank in any part of the row. This means that the number rotates as it shows the position of the row found. If no escapes are detected, the zero rotates.

Please note that the search is related to the registry. If there is more than one input in a row in a cob row, the function is to turn the ear of the first input.

Know (“one, two, one, two, three”, “two”) // Function rotate number 6

Empty stitch

Using this function allows you to determine whether the row is empty. Minor characters, such as spaces, carriage moves, and others are not covered.

EmptyRow (“Pupkin Vasil Ivanovich”) // function of rotating value Nonsense
EmptyRow() ") // function rotate value True

VReg, NReg, reg

These functions are even different when regular changes are made. “Reg()” rotates the outgoing row in the upper case, “Reg()” in the lower case, and “Treg()” formats it so that the first character of the skin word will have a big letter, and all the next ones will have a small letter.

VReg("GENERAL DIRECTOR") // the value that rotates - "GENERAL DIRECTOR"
NReg("CEO"
TREG (“GENERAL DIRECTOR”) // the value that rotates – “General Director”

PageReplace

This function is similar to replacing text editors. It allows you to replace one character or set different characters for regular changes.

StrReplace(“red, white, yellow”, “,”,” “;”) // turn “red; white; Zhovtiy"

PageNumberRow

The function allows you to determine the number of rows separated by carriage transfers in the text change.

The cycle, at the lower butt, will go through three stakes, the fragments of the function StrNumber rotate value 3:

For ind=1 by StrNumberRow (“Row1” + Symbols.PS + “Row2” + Symbols.PS + “Row3”) Cycle
<тело цикла>
KіnetsCycle;

LineOtrimatiRow

This function works with high-order text in the same way as the previous one. This allows you to remove the row from the text row.

LineString("Row1" + Symbols.PS + "Row2" + Symbols.PS + "Row3", ​​2) // turn "Row2"

PageNumberInhodzhen

The function adjusts the number of entries in a symbol or order in a row.

StrNumberInvestment("a;b;c;d",",";") // function rotate number 4

Symbol and CodeSymbol

These functions allow you to extract the character behind the code from the Unicode code, as well as the value of the code behind the character itself.

CodeSymbol("A") // function rotate number 1040
Code for Symbol (1040) // Rotate function “A”

Parts of the job under the hour of work in rows

Combination of rows

To combine a number of rows (to create concatenation), it is enough to use the addition operator.

"Row 1" + "Row 2" //the result of adding two rows will be "Row 1 Row 2"

Re-creation of types

In order to convert the type into a row, for example, a message sent to an argument element, a number, or something else, it is enough to use the “Row()” function. Functions similar to “Scratch()” will automatically transform variables into a row, or even into a row of unimportant symbols.

Row (1000) // rotate “1 000”

Please note that when you put the numbers in a row, the program automatically added a space, which adds up to a thousand. In order to achieve this uniqueness, you can quickly use the following constructions:

StrReplace(Row(1000),Characters.NPP,"") // rotate "1000"

Row (Format (1000, "CHG =")) // rotate "1000"

Paws in a row

You will often find yourself faced with the need to speak to the common man. You can enter the text, write it in the configurator, or just change it. To complete this task, you only need to insert two paw symbols.

Heading = Row (“TOV “Rogi ta kopita” - tse mi!”) // turn “TOV “Rogi ta kopita” - tse mi!”

Bagatory row, transferred row

In order to create a richly ordered text, it is enough to add to the new symbol of the transferred row (Symbols.PS).

Bagatory Row Text = “First Row” + Symbols.PS + “Another Row”

How to tidy up the clearings

In order to clean up the gaps right-handed or evil, you can quickly use the function “ScrAP()” (as well as “ScrL()” and “Scratch()”):

RowWithoutGaps = AbbrLP("Lots of letters") // function to rotate the value "Lots of letters"

If, after putting the numbers in a row, you need to collect unbroken clearings, use the following construction:

RowWithoutGaps = StrReplace(Row(99999),Symbols.NPP,"") // rotate "99999"

Also, programs often contain a lower-level construction that allows you to delete or replace with another character the entire text field:

Row Without Gaps = Page Replace (“reception”, “”) // turn “hello”

Alignment of rows among themselves

The terms can be equated with a basic sign of equality. When updated, the register is insured.

“Hello” = “hello” // turn around Nonsense
“Hello” = “Hello” // actually True
“Hello” = “Until the day” // turn around Nonsense

Up to the basic capabilities of your programming, you need to bring the robot with numbers and rows. Consider the possibility of hardening it into the compiler code (or implementing “basic” classes of programming).

In 1C Possibility, robots with rows are programmed on the platform itself. Today we will look at the peculiarities of working with 1C rows in the programs introduced by 1C.

Values ​​of row 1C

1. Let's start with the simplest things. The creation of the variable and the addition of its row constant value looks like this in 1C:

Zminna = "Hello, world!";

If you need to enter a foot symbol in a constant row value 1C, you need to enter “”

Zminna = "Hello, "light"!";

2. The transfer of row 1C can be done in two ways. The first one – from the corresponding symbol |

Zminna = "Hello,
| world! ";

The other is due to the distortion of the systemic re-interpretation of the Symbols. It allows you to add the transfer of the 1C row, as well as other undirected characters, for example TAB.

Zminna = "Hello" + Symbols. PS + “light!”;

3. Configurations in 1C can be divided not only for one movie (Russian, English or others) - but also for many movies at the same time. In this case, the language that is being reviewed at this time is selected in the lower part of the 1C window.

The list of MOVs can be found in the configuration window of the Guilt Zagalnya/Mov. The skin language has a short identifier such as ru or else eng.

It is clear that when programmed in such a configuration, row 1C can also be rich in volume. For whom it is possible to create such a row 1C by entering through; Movie ID options:

Zminna = "ru=""Hello, world!"; en=""Hello, world! """;

If you vikorystuvate the formations so row 1C as always, then it will be what is written in it. In order for the system to split it into two options and select the required one, it is necessary to use the HST() function:

// Correct for two-layer configurations
Povidomity(NStr(Zminna));

Props from the type of row 1C

Details – this is the field of the witness/document 1C. It appears as a change in the 1C program because the details clearly indicate its type (number, row 1C, etc.). If you need to refresh your memory, what are the details - marvel at the lesson, dedications.

If you specify the type of details - row 1C, you will also need to specify parameters.

Rows 1C include unbounded dovzhin (specified as dovzhina = 0) and surrounded dovzhin, depending on the exact number of symbols specified. The 1C rows of the unbounded period are stored in a separate SQL table, so their successors are less productive and less edged.

Moreover, the vicoristic rows of 1C uncircumscribed dozhin have their own intercalation - it is not through them that you can vicorize. For example, it is not possible to specify the document number, the identification code, or the identification number.

Robot in rows 1C

For work with rows there are a number of built-in functions of the 1C platform.

  • Abbreviated ("It's a fact, it's a fact!")
    Takes from a row 1C fields of glades. It is also possible to recreate any type up to 1C (for example, numbers).
  • Zminna = “Vasya” + AbbrLP (“plus”) + “Olya”; //will be "Vasya plus Olya"
    The butt is calculated in a number of rows, value 1C. The result is one row 1C.
  • Zminna = Leo ("Music", 2); //will be "Mu"
    Zminna = Seredovishche ("Music", 2, 2); //will be "zi"
    Zminna = Right("Music", 2); //it will be "ka"
    There are different options for selecting a row from the 1C row.
  • Zminna = Know("Music", "Z"); //there will be 3
    Search for rows in row 1C, starting from symbol 1.
  • Zminna = StrLength("Music"); //there will be 6
    Rotates a number of symbols in row 1C.
  • Notify("Hello") //notify at the bottom of the 1C window
    Poperedzhennya (“Hello”) // dialogue window that merges.
    Stan (“Hello”) //I’ll stand in the row at the bottom of the evil
    .

Reducing objects to 1C row

Apparently, the most popular format for exchanging structured information at the moment is XML. The current version of MS Office Word and Excel saves files in this format (docx and xlsx obviously, change the extension to zip, open in the archiver).

The 1C platform offers a number of options for exchanging data, the main one being XML.

1. The simplest method is to use the functions Abbreviation() or Row(). In the text, you can use the REPRESENTATION() function. The result of this action is the same - the stench is generated by a series of representations of any 1C object for the customer.

For the witness for the murder, this will be called his name. For a document – ​​document name, number and date.

2. Any 1C object (with boundaries) can be transformed into XML and back. The transformation process is called serialization.

RowViewXml = XMLRow(Value); //remove XML from 1C values
Value1C = XMLValue(Type("DovidnikPosilannya.Nomenclature"),RowTypeXml); //reject the 1C value from the XML row, you must specify the 1C type, which can be rejected

3. There is a powerful way for the 1C platform to transform any 1C object into a row. It was migrated from version 1C 7.7. This format cannot be understood by other programs, but is understood by the other 1C, which makes it easy to use for exchange between 1C databases.

Row = ValueInRowInt(Value1C); //remove row 1C value 1C
ValueFile("C:\MyFile.txt", Value1C); //another option, extract the file from the saved row from the 1C value
Value1C = Value/RowInternal(Row); //back charge 1C
Value1C = ValueIzFile("C:\MyFile.txt"); //back to file

Editing 1C rows on the form

When working with 1C rows in the 1C program, I would really like the user to be able to edit them. For which there is a bunch of possibilities:

1. The simplest way is to request the entry of a 1C row in the window. This method of vikorista when you start programming 1C, in life it will become stagnant much sooner (or it will stagnate!).

Zminna = "";
Row = EnterValue(Zminna, "Enter PIB");

2. To display the details of a 1C object (document/document) or the details of a form (div.), most often use the entry field. This is the most advanced 1C tool for robotic editing with field editing.

3. The power of the entry field can be expanded (the power of the entry field can be expanded using the right button on the new report):

  • Checkbox Bagatory mode editing
  • Tick ​​More editable (available if the front tick is inserted)
  • Checkbox Password mode (div.).

4. If you don’t see all the possibilities of the input field, the editor does. To add to the form, you need to add Text Document Field in the menu Form/Insert element element. In your power, you can select the robotic mode – Power Expanded.

The field of a text document cannot be directly linked to data. It is necessary to write the function in the subscript of the Attribute() form (div.):

ElementForm.ElementNameTextDocumentField.SetText(RowValue); //here ValueRow - this is the text of the abbreviations, for example with details

And in the savings book - for example, at the Save button - add savings:

ValueRow = ElementForm.ElementNameTextDocumentField.OtrimatiText(); //ValueThe row here is the props where we save the values

5. In 1C version 8.2.11, kerated forms have a new ability to submit a row of 1C – the Document Formatting field.


Similar to the fields in a text document, you must install them when you open them and write them when saving them yourself using additional programs.

  • Before the 1C object, the form of any kind (document, document, processing, etc.) - add details with the type of Value.
  • In the function Received on the server (), the text from the details can be inserted

    //Here Props - here you need to add the details of the 1C object
    //here Formatting Document – ​​this is the name of the field on the form for editing
    &On the server

    FormattingDocument = CurrentObject.Properties.Otrimati();
    KinetsProcedures

  • In the function BeforeWriteOnServer() or using the button we will write the text from the field

    &On the server
    Procedure When reading on the server (Stream object)
    ExactObject.Properties = New ObjectValue(FormatDocument);
    KinetsProcedures

PART 1. METHODS (26).

1.1. Basic methods (10). Independent, based on their own simple algorithms.

Page_Add() (addition of right-handed-left-handed symbols).

Page_Inverse () (inversion - symbols right-handed to left).

Page_Code() (character codes through ”,” and an array of codes)

Page_Characters() (row of codes through ”,” or array of codes)

Stor. ReplaceSymbols() (replacing characters with other ones).

Page_FromArray() (row with an array of fragments through a separator)

Page_FindIn() (search for a sequence (including right-handed) with the specified input number).

Page_FindGr() (Search for a group of characters to include in character set instructions)

Page_FindNumber() (Search for a number, including the one on the right with the specified input number)

Page_Interpret() (in an array, with inserted syntax)

1.2. Pokhіdnі methods (12). Vlasna, tse zastosuvannya kotyriykh zagalennyh methods-algorithms (div. Part 2)

Page_Number() (from the beginning to the end of the row, do not be “afraid” of non-numeric characters.

Page_Find() (sequence search (including without register adjustment and right-handed) with specified input number).

Page_Replace() (search (for example, without case adjustment and right-handed), and replace delimiter substrings).

Page_Piece() (pieces of the row between the designated inputs of the separator (left-handed or right-handed)).

Page_ReplacePiece() (replacing the output row “stuff” with the input row).

Page_ВArray() (between the designated inputs of the separator (selected right-handed and register).

Page_TransferBySyllables() (split into rows “Horstko”, with a hyphen).

Page_MoveByWords() (split into rows "M'yako")

Page_Rollout() (“Rollout” for the rows of the specified dovzhins)

Page_Short() (replace the left group of "shortened" symbols with the "replacement row")

Page_Shorten() (replace the right group of "short-lived" symbols with the "replacement order")

Page_ShortS() (replace the middle of the group of “shortened” characters with the “replacement order”)

page_Expand (extend up to specified dovzhiny for rahunok increase the number of specified characters)

1.3. Detailed methods (3). "Preparation" of the row has been moved to a table with detailed information.

Page_vTableIn() (the table has a system of nested separators).

Page_vTableGr (the table is complete with a rich filter).

Page_inTableNumbers (a table with numbers and fragments between them).

PART 2. UZAGAL METHODS-ALGORIMS (3).

Page_Login() (methods “Find” and “Replace”).

Page_Fragments() (methods “Piece”,”ReplacePiece,”InArray”,”in TableVx”).

Page_Skr () (methods "SkrL", "SkrP", "SkrS", "Rozwidth".

Page_Rozbit() (methods "TransferBySyllables", "TransferByWords", "Rozzati").

PART 3. UNIVERSAL FUNCTION.

This is a kind of smart software interface that allows

Stack up to a number of methods. Implementations at a glance

functions with these parameters ("Demo" is based on this function):

Page_(Methods, Submethods, Input, Param1, Param2, Additional_Position_Numbers, Additional Output)

Parameters:

- “Methods” - a bunch of “crazy” ones and (or) one “exclusive” method

(transferable codes or names are possible via ",")

- “Methods” - a number of “crazy” and (or) “monopoly” options

"exclusive" method (one-character codes and names);

- "Input" - Row or Array or Table value;

- “Param1” - search row, substitution, separators, filters;

- "Param2" - replacement row or symbol;

- "Dovzhini_Numbers_Positions" -Number, Numbers through a separator or an array with Numbers;

- "Additional Width" - Number or Row or Array or Table value;

Names and (or) one-character codes of method-submethods, as well as numbers in

(Double_Numbers_Positions) may be in any register and registration

be-any of the upcoming separators: “, :;”.

PART 4. BUTTS.

ЄNumbersInRow=(Str_KnowNumber(InRow)<>NOT specified);

ЄDigitsInRow=(Str_FindGr(InRow,"+0123456789")>0);

ЄLatin=(Str_FindGr(InxStr, Str_Interpret("lL"))>0);

ЄVkaznіSigns=(Str_NFindGr(VxStr, "+to rogYu.0p9")>0);

ЄNeDrukarni = (Str_FindGr(VxStr, Str_Interpret("-l-L-r-R-P-Z-C"))>0);

PART 5. VISNOVOK.

It’s possible, making do with one pass in a row. Another pass - ring for the fragments. Without using the function StrNumberInput().

The following functions have been added: Lev(),Right()Med(),Strength()

- (positioning and trimming parts of the row - may be “shvidky”).

Implemented in version 8.3.6.1977.

We have expanded the range of functions for working with rows. We created this in order to give you advanced tools for analyzing row data. The new functions will be handy and complementary to technologically advanced text analysis. In tasks related to text parsing, which corresponds to data in a formatted view. This can include analysis of any files acquired during ownership, or, for example, analysis of a technological journal.

All events that introduce new functions can be deleted before. For additional help, there are fewer complex algorithms written by my inspiration. Therefore, the new functions do not give you any new capabilities. However, they allow you to shorten the code, making it easier and more understandable to work out the code. And besides, the stench allows you to speed up the war. Because the functions implemented in the platform operate, essentially, below a similar algorithm, written by mine.

Function formatting StrTemplate()

This function provides row parameters. The need for such a re-creation often arises, for example, before the hour of notification of those in advance. The syntax of this function looks like this:

StrTemplate(<Шаблон>, <Значение1-Значение10>)

<Шаблон>- The sequence in which it is necessary to enter the parameters.

<Значение1> , ... <Значение10>- These parameters (maximum ten) that need to be put in a row.

To specify a specific place in the template where you need to select a substitution, you need to select a marker like %1, ... %10. The number of markers assigned to the template, as well as the number of parameters for changing the values, may be lost.

For example, the result of the wiki of such an operator is:

there will be a row:

Data processing for row 2 (Date type required)

Row robot function Compare()

This function equalizes two rows without adjusting the register. For example, like this:

This is exactly what you could have signed out of earlier for the additional object of RenewalValue:

However, the introduction of a new function seems to be more straightforward. In addition, this function, under the ChangeValue object type, works in both the thin client and the web client.

Functions of robots with rows LineStartsWith(), LineEndsWith()

These functions indicate whether the row begins with the designated order and whether the row ends with the designated order. The algorithm of these functions is difficult to implement by design, but their clarity allows you to write cleaner and more intelligent code. I smell the swedish stench.

For example, they can be manually corrected in the Yakshcho operator:

Robot functions with rows Build()

These functions divide the row into parts behind the specified divider. Otherwise, combine a number of rows into one, inserting a selection separator between them. The results are manually created and analyzed by logs, technological journal. For example, a technological log entry can be easily divided into parts for further analysis:

Robot row function StrFind()

Instead of the old function Know(), we implemented a new function that has additional capabilities:

  • Poshuk in different directions (from the beginning, from the end);
  • Search from the designated position;
  • Search for entry from the assigned number (another, third, etc.).

In fact, it duplicates the capabilities of the old function. This is done in order to save confusion with modules compiled from older versions. It is recommended not to revise the old function Know().

The butt is pointed lower, which is the vikorist’s new possibility of a joke. Searching directly is handy if you need the remaining fragment of a formalized row, for example, outside the URL file. And the joke from the designated position helps in these situations, if you need to joke in a particular fragment, and not in the whole row.