New functions of robots with rows. New functions of robots in rows 1C 8.3 functions of robots in rows

Golovna / Basic functionality

Rows in 1C 8.3 for the imported 1C language have primitive type values Row. The meaning of this type is to replace the row in the Unicode format for quite a long time. Changes of the row type are a set of symbols of joints at the foot.

Example 1. Let's create a simple text.

Ryadkova Zminna = "Hello world!";

Functions of robots with rows 1s 8.3

This section will have basic functions that allow you to change rows in 1s, or analyze the information that fits in them.

LineLength

StrLength(<Строка>) . Rotates the number of characters to fit in the row passed in the parameter.

Example 2. Check the number of symbols in the “Hello world!” row.

Row = "Hello world!"; Number of Characters = StrLength(Row); Announce (Number of Characters);

The result of this code will be displayed on the screen for the number of symbols in a row: 11.

AbbrL

AbbrL(<Строка>) . There are unimportant symbols that stand left-handed before the first symbol in a row.
Minor characters:

  • break;
  • the clearing is unbreakable;
  • tabulation;
  • carriage rotation;
  • row shift;
  • translation of the form (side story).

Example 3. Clean up all the clearings from the left side of the light row! and add the “Hello” row to it.

Row = AbbrL ("light!"); Row = "Hello" + Row; Show(Row);

By typing in your code, your code will be displayed on the screen in the “Hello world!” row.

Abbreviated

Abbreviation(<Строка>) . There are unimportant symbols that stand right next to the first symbol in a row.

Example 4. Form a series of “Hello” and “Svit!” the phrase “Hello world!”

Row = Abbreviation("Hello")+"+ Abbreviation("light!"); Show(Row);

AbbrLP

AbbrLP(<Строка>) . There are also unimportant symbols that stand right-handed before the first character in a row, and there are also unimportant symbols that stand left-handed before the first character in a row. This function is used more often than not, since it is more universal.

Example 5. Obtain unimportant symbols left-handed and right-handed from the hired counterparty.

Counterparty = Authorities. Counterparties.KnowByRequisite("IPN", "0777121211"); CounterpartyObject = Counterparty.OtrimatiObject(); Counterparty Object. Name = AbbrLP (Counterparty Object. Name); CounterpartyObject. Write();

a lion

A lion(<Строка>, <ЧислоСимволов>) . Removes the first characters of a row, the number of characters specified in the parameter Number of characters.

Butt 6. Go to the structure Spivrobitnik The name is used, the nickname is from my father’s military uniform. Remove the row from the name and initials.

Initial = Lev(Spivrobitnik.Im'ya, 1); Initial of Batkivshchyna = Leo (Spivrobitnik. Po-Batkovy, 1); Outside Im'ya = Spivrobitnik. Nickname + " " + Initial of the name + "." + Initiative of Fatherland + ".";

I use the walkie-talkie

Right(<Строка>, <ЧислоСимволов>) . Selects the remaining symbols of the row, the number of symbols specified in the parameter Number of characters. If the number of symbols is specified and moves the bottom of the row, the entire row is rotated.

Example 7. For example, if you change the row, the date is written in the format “yyyymmdd”, remove the row with the date and change it to the type date.

Row = "Line date: 20170910"; RowDate = Right(Row, 8); Date = Date(RowDate);

Seredovishche

Seredovishche<Строка>, <НачальныйНомер>, <ЧислоСимволов>) . Removes the order from the order passed in the parameter Row, starting with the symbol, the number of each indication in the parameter Cob Number and the additional amount passed to the parameter Number of characters. The numbering of characters in a row starts from 1. Cob Number If a value is specified, less than or equal to zero, the parameter takes the value 1. As a parameter Number of characters not specified, symbols are selected until the end of the row.

Example 8. In the next row, starting from the ninth position, enter the region code, then select it and write it down in the next row.

Row = "Region: 99 r. Moscow"; Region = Seredovishche (Row, 9, 2);

PageFind

StrFind(<Строка>, <ПодстрокаПоиска>, <НаправлениеПоиска>, <НачальнаяПозиция>, <НомерВхождения>) . This function searches for the specified order in a row and turns the position number of the first symbol of the found order. Let's take a look at the parameters of this function:

  • Row. Exit row;
  • PodryadkaPoshuk. Rushing in a row;
  • Directly Search. Directly indicates a search for a row in a row. You can take the following values:
    • Straightforward, by joke.;
    • Directly I'll ask.;
  • PochatkovaPosition. Indicates the position in the row from which the search begins;
  • RoomEntrance. Indicates the entry number of the selected row in the output row.

Example 9. In the row "Hello world!" indicate the position of the remaining input to the “i” symbol.

PositionNumber = StrFind("Hello, world!", "i", DirectlySearch.End); Announce(PositionNumber);

When you enter your code, the number of the remaining input to the “i” symbol will be displayed on the screen: 9.

VReg

VReg(<Строка>) . Converts all characters of the specified row in 138 to uppercase.

Example 10. Reverse the row “Hello, world!” to upper case.

RowVreg = VRreg("hello light!"); Show (Row);

By entering your code, your code will be displayed on the screen in the “HELLO SWIT!” row.

NReg

NReg(<Строка>) . Converts all characters of the specified row in 1s 8 to lower case.

Example 11. Reverse the row “HELLO SWIT!” to lower case.

RowNreg = NReg("HELLO SWIT!"); Show (Row);

By typing in your code, your code will be displayed on the screen in the “Hello World!” row.

treg

treg(<Строка>) . The row is rearranged with the next step: the first character of the word is converted to upper case, the last symbol of the word is converted to lower case.

Example 12. Earn great first letters in the row “Hello, world!”

RowTreg = TReg("hello light!"); Show(RowTreg);

By typing in your code, your code will be displayed on the screen in the “Hello World!” row.

Symbol

Symbol(<КодСимвола>) . Removes the character behind the Unicod code.

Example 13. Dodamo left-handed and right-handed in the row “Hello World!” symbol ★

RowZi with stars = Symbol("9733")+"Hello World!"+Symbol("9733"); Announce (Row with Stars);

By typing in your code, your code will be displayed on the screen in the “Hello World!★” row.

CodeSymbol

CodeCharacter(<Строка>, <НомерСимвола>) . Retrieves the code for a character in Unicode of the order assigned in the first parameter, expanded in position, assigned to another parameter.

Example 14. Find out the code for the remaining symbol in the “Hello World!” row.

Row = "Hello World!"; CodeSymbol = CodeSymbol(Row, LineLength(Row)); Show(CodeSymbol);

When you enter your code, the symbol "!" will be displayed on the screen. - 33.

Empty stitch

Empty stitch(<Строка>) . Checks whether a row of only insignificant symbols is formed, so that it is empty.

Example 15. Check that the empty row consists of three spaces.

Empty = EmptyRow(" "); Povidomity(Empty);

The result of this code will be the display of the words “So” on the screen (a regular expression of logical meaning Truth).

PageReplace

Page Replace (<Строка>, <ПодстрокаПоиска>, <ПодстрокаЗамены>) . Find out all the input rows in the output row and replace them with the replacement order.

Example 16. In the row "Hello World!" replace the word "World" with the word "Friends".

Row = StrReplace("Hello World!", "World", "Friends"); Show(Row);

By typing in your code, your code will be displayed on the screen in the “Hello Friends!” row.

PageNumberRow

StrNumberRow(<Строка>) . Allows you to cultivate a number of rows in a row. To move to a new row 1c 8, the symbol is vikorized PS(Symbol for row reversal).

Example 17. Calculate the number of rows in the text:
"First row
Another row
Third row"

Number = StrNumberRow("First row" + Symbols. PS + "Another row" + Symbols. PS + "Third row"); Show (Number);

The result of this code will be the number of rows of text displayed on the screen: 3

LineOtrimatiRow

StrOtriMatiRoku(<Строка>, <НомерСтроки>) . I subtract the row from the row after the yth number. The numbering of rows starts from the first.

Example 18. Remove the remaining row from the text:
"First row
Another row
Third row"

Text = "First row" + Symbols. PS + “Another row” + Symbols. PS + "Third row"; RemainingRow = StrOtrimatiRoku(Text, StrNumberRow(Text)); Show(OstAnyaRow);

By typing in this code, your code will be displayed on the screen of the “Third Row” row.

PageNumberInhodzhen

StrNUMINCODE(<Строка>, <ПодстрокаПоиска>) . Rotates a number of entries of the designated row into a row. The function is register sensitive.

Example 19. Determine how many times the letter “c” is entered before the row “Rows in 1c 8.3 and 8.2”, regardless of its register.

Row = "Rows in 1c 8.3 and 8.2"; NumberInput = StrNumberInput(Vreg(Row), "C"); Povidomity(NumberInputs);

The result of this code will be the display of the number input: 2.

BeginsWith

StartsWith(<Строка>, <СтрокаПоиска>) . It checks and begins the series of transmissions in the first parameter, and the series in the other parameter.

Example 20. Significantly, the IPN of the selected counterparty begins with the number 1. Don’t forget the change Counterparty Counterparties.

IPN = Counterparty.IPN; BeginsUnits = StrBeginsWith(IPN, "1"); How it startsUnit Todi //Your code EndYaksto;

PageEndsAt

StrEndsWith(<Строка>, <СтрокаПоиска>) . Checks whether the series of transmissions in the first parameter ends, and the series in another parameter.

Example 21. It means that the IPN of the selected counterparty will end at number 2. Please contact the exchanger Counterparty Sending messages to the appendix item is saved. Counterparties.

IPN = Counterparty.IPN; Ends With Two = Page Ends With (IPN, "2"); How to end on two days // Your code End How;

Share

Divide(<Строка>, <Разделитель>, <ВключатьПустые>) . Divides the row into parts following the specified separating symbols and records the subtracted rows from the arrays. The first parameter saves the exit row, the second parameter sets the row to place a separator, the third specifies whether it is necessary to record empty rows in the array (after cleaning Truth).

Example 22. If we have a series where we can separate numbers separated by the symbol “;”, we can select an array of numbers in order.

Row = "1; 2; 3"; Array = ROZDILITI(Row, ";"); For Account = 0 By Array. Quantity () - 1 Cycle Sample Array [Sch] = Number (AbbrLP (Array [Sch])); Vinyatok Masiv [Sch] = 0; EndTry EndCycle;

As a result, an array of numbers from 1 to 3 will be selected.

StrZ'ednati

StrZ'ednati(<Строки>, <Разделитель>) . Converts the array of rows from the first parameter to a row in order to place all the elements of the array through the separator, the values ​​of another parameter.

Example 23. Vikoristovuyuchi array of numbers from the front butt, keep the exit row.

For Account = 0 By Array. Quantity () - 1 Cycle Array [Sch] = Row (Array [Sch]); KіnetsCycle; Row = StrZ'ednati(Array, "; ");

Sheet music from Behind the Looking Glass

08/18/2014 New functions of robots in rows

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 quit earlier for another object RankValue:

However, the introduction of a new function seems to be more straightforward. What is the function of the object? RankValue It works both in the thin client and in 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 easily vicorized in the operator Yakshcho:

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()

Replacing the old function know() We have 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. Old function know() It is recommended not to vikorize anymore.

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 file name in the URL. 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.

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 summarized to 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.

© 2024 androidas.ru - All about Android