Contacts

Type limit in the list of values. Type limit in the list of values \u200b\u200b1C values \u200b\u200blist available values

Unit 10. List of values \u200b\u200bin Language 1C (in Examples)

Description:

The list of values \u200b\u200bis not saved in the database object that allows you to build to solve interface tasks dynamic sets Values \u200b\u200band manipulate them (add, edit, delete elements, sort). It can be filled with values \u200b\u200bof any type, i.e. In one list, the types of stored values \u200b\u200bmay be different. One example of use this object There may be an organization of choosing a specific document from the list of possible documents formed on a complex algorithm.

Collection elements: ElementSPCDs

For the facility is available bypass collection by operator For each ... Of ... Cycle. When traversery, elements of the collection are selected.

It is possible to appeal to the collection element by operator [...]. An element index (numbering from 0) is transmitted as an argument.

Properties:

Available

It is applied in cases where it is required to limit the possibility of setting the values \u200b\u200bfor the list items by some subset of values \u200b\u200bof the valid type (if the list is set to the list). Undefined - There are no restrictions.

Installing this property affects the operation of the dialog for editing the list of values, the "Table" control elements and a "input field" associated with the list of values, as well as on the program add-inserting a new list of values \u200b\u200band setting the values \u200b\u200bof lists items.

Type

Determines the type for values \u200b\u200bthat can be stored in the items of this list of values.

Insert (,)

Inserts a new element in the list of values \u200b\u200bto a position with a submissance index.

Choose element (,)

Element - The element to which initially socose a list of values \u200b\u200bduring an interactive choice should be originally. If the parameter value is not the list of values \u200b\u200bincluded in this listPositioning will not happen.

Unloading ()

Creates an array and copies the values \u200b\u200bof the list of values \u200b\u200bto it.

Add (,,) adds a new item to the end of the list of values.

Download ()

Loads the list of values \u200b\u200bwith the values \u200b\u200bof the transmitted array. At the same time, all previous elements of the list are deleted.

Fuelings ()

Sets the mark from all elements of the list of values. Index (Oleman\u003e)

Gets an element index in the list of values. If not found, then returns -1.

Number()

Gets the number of values \u200b\u200blist items.

Findback ()

Searches the value of the values \u200b\u200bof the list item. If no item stores the value equal to the desired, then the value is returned. Undefined.

Find Point ()

Gets an item of the list of values \u200b\u200bby identifier. If the item is not found, then returns Undefined.

Mixlements ()

Sets or removes (interactively) marked from the elements of the list of values. Returns Trueif the "OK" button is pressed in the dialog False - otherwise.

Clear ()

Clears the list of values \u200b\u200bby removing all the elements from it.

Shone Element (,)

Calls a window for an interactive selection of one of the elements included in the list of values.

View set tolements ()

Designed for interactive setting of states of marks from the elements of the list of values.

Receive()

Gets the value by index. Works similarly to the operator);

EndCycle;

III How to find a list item by its value in 1C

Valorist \u003d List. ONETITING ("Tuesday");

III How to find out the index of the element in the list in 1C

Report (list. INDEX (SALCHERTER));

// 1, as the numbering from scratch

III How to sort the list by its values \u200b\u200bin 1C

List. Sort-to-state

(Directional separation. Yes);

III How to delete an item from the list of values \u200b\u200bin 1C

// Delete the first element list. Delete (list);

// Parameter: List Element

III How to shift the list of values \u200b\u200bin 1C

// We shift the first element to one position forward list. Slip (0, 1);

III How to make a copy of the list in 1C

Copy Scripture \u003d list .Copy);

Colors \u003d new list of accommodation ();

Colors. Add ("red");

Colors. Add ("green");

Colors. Add ("blue");

III How to upload the list values \u200b\u200bin an array in 1C

Massivecets \u003d colors. Unloading ();

III How to download the list values \u200b\u200bfrom the array in 1C

Colors. Suggestions (massicles);

III How to make a modal choice of value from the list in 1C

Team \u003d

Colors. Evialement ("Select Favorite Color"); If you choose the ones indefinitely, then report (seen.

Ended;

III How to make a modal mark of values \u200b\u200bfrom the list in 1C

If colors. Ease elements ("Select Favorite Colors") then

For each color from color cycle if color. Mark then to report (color);

Ended;

EndCycle;

Ended;

// You can set all the marks in specific value Colors. Fuelings (truth);

Full syntax (click to disclose)

Slip list

Description:

The list of values \u200b\u200bis the object that is not saved in the database that allows you to build dynamic sets of values \u200b\u200bfor solving interface tasks and manipulate them (add, edit, delete elements, sort). It can be filled with values \u200b\u200bof any type, i.e. In one list, the types of stored values \u200b\u200bmay be different. One of the examples of using this object can be the organization of choosing a specific document from the list of possible documents formed by a complex algorithm.

Collection elements: ElementSPCDs

For the facility is available bypass collection by operator For everyone ... from ... cycle. When traversery, elements of the collection are selected.

It is possible to appeal to the collection element by operator [...]. The element index is transmitted as an argument ( numbering from 0.).

Properties:

Methods:

Insert (index, value, view, mark, picture) inserts a new item to a list of values \u200b\u200bto a position with the specified index.Select element (header, item) calls a window for an interactive selection of one of the items included in the list of values. Element - The element to which initially socose a list of values \u200b\u200bduring an interactive choice should be originally. If the value of the parameter is not the list of values \u200b\u200bincluded in this list, positioning will not occur.Unloading() Creates an array and copies the values \u200b\u200bof the values \u200b\u200blist items.Add (Value, View, Mark, Picture) Adds a new element to the end of the list of values.Download(Massive) loads the list of values \u200b\u200bwith the values \u200b\u200bof the transmitted array. At the same time, all previous elements of the list are deleted.Film player(Mark) Sets the mark from all elements of the list of values.The index (element) receives an element index in the list of values. If not found, then returns -1.The number () receives the number of values \u200b\u200blist items.Found content(Iscomed) Searches for the value of the list of values \u200b\u200bitem. If no item stores the value equal to the desired, then the value is returned. Undefined. Foundationant(Identifier) \u200b\u200bGets an item of the list of values \u200b\u200bby identifier. If the item is not found, then returns Undefined. Mental elements(Title) Sets or removes (interactively) marked from the values \u200b\u200blist items. Returns Trueif the "OK" button is pressed in the dialog False - otherwise.Clear () Clears the list of values \u200b\u200bby removing all items from it.Shone element(Description Enterprise, header, element) Causes a window for an interactive selection of one of the elements included in the list of values.View set tolements(Description Enterprise, header) is intended for interactive setting status marks from the elements of the list of values.Get (index) gets the value of the index. Works similarly to the operator.Shift (element, offset) shifts the list of values \u200b\u200bto the specified number of positions forward or backward.Copy () creates a copy of the list of values.Sortictive(Direction) Sorts a list of values \u200b\u200bin ascending order or descending by stored elements of values. See Example below.Sortpopsert.(Direction) Sorts a list of values \u200b\u200bascending or descending in the alphabetical manner of submissions of the list of elements included in the list. See Example below.Delete (element) deletes an item from the list of values \u200b\u200bwhere Element - index of the removed item, or the element itself.

Designers:

New list of accommodation
& Caltente Procedure PerformCode (Team) /// How to create a list of values \u200b\u200bin 1C 8.3, 8.2 List \u003d new list of accommodation; /// How to add an item to the list of values \u200b\u200bin 1C 8.3, 8.2 // Method Parameters Add: // - Value // - representation // - Mark (optional) // - picture (optional) List. Add (1980, // Value element "Year of birth Vasi" // representation ) ; List. Add (1985, "Year of birth of Julia") ; // values \u200b\u200bcan be different types List. Add ("Polina", "Baby Name"); /// How to insert an item in the list of values \u200b\u200bin 1C 8.3, 8.2 // Insert into position number 2 (items are numbered from 0) // Element with the 2010 value and representation // "Year of birth of their joint daughter" List. Insert (2, 2010, "The year of birth of their joint daughter") ; /// How to bypass the elements of the list of values \u200b\u200bin 1C 8.3, 8.2 For each element from the loop list, report (element. View + ":" + string (element. Value)); EndCycle; /// How to Clean List of Values \u200b\u200bin 1C 8.3, 8.2 List. Clear (); List. Add (Monday); List. Add ("Tuesday"); List. Add ("Wednesday"); /// How to find out the number of items of the list of values, as well as /// Get an element of the list by its index in 1C 8.3, 8.2 // Numbering from scratch For index \u003d 0 on the list. Quantity () - 1 cycle Report (list [index]); EndCycle; /// How to find an element of the list by its value in 1C 8.3, 8.2 Valorist \u003d list. Found content (Tuesday); /// How to find out the index of the element in the list in 1C 8.3, 8.2 Report (List. Index (Signalist)); // 1, as the numbering from scratch /// How to sort the list by its values \u200b\u200bin 1C 8.3, 8.2 // was: Monday, Tuesday, Wednesday List. Sorting (directions. Decession); // Stable: Wednesday, Monday, Tuesday /// How to delete an item from the list of values \u200b\u200bin 1C 8.3, 8.2 // Remove the first element // Parameter: List Element // or element index // You can so a list. Delete (list [0]); // or so // list. Delete (0); /// How to shift the list of values \u200b\u200bin 1C 8.3, 8.2 // We shift the zero element for one position forward // was: Monday Tuesday List. Shift (0, 1); // Stably: Tuesday Monday /// How to make a copy of the list in 1C 8 Copy Scripture \u003d List. Copy (); Colors \u003d new list of accommodation; Colors. Add ("red"); Colors. Add ("green"); Colors. Add ("blue"); /// How to unload the list values \u200b\u200bin an array in 1C 8.3, 8.2 Massivecets \u003d colors. Unloading (); /// How to upload the values \u200b\u200bof the list from the array in 1C 8.3, 8.2 Colors. Downloads (mass arms); Extrudresses /// How to make a formal choice of value from the list /// Values \u200b\u200bin 1C 8.3, 8.2 & Clause procedure Assessing the alignment) of color \u003d new list of output; Colors. Add ("red"); Colors. Add ("green"); Colors. Add ("blue"); // Postwear procedure is defined just below AlertsLabelectable element \u003d new description computer ( "Postwar element", This object); Colors. Shone element (notification of lightbreaker, "Choose your favorite color" ); End Controlments & Communication Postwar Element Procedure (Element, Parameters) Export If the Element<> Uncertain then to report (item. Value); Ended; Extrudresses /// How to make a non-modal mark of values \u200b\u200bfrom the list /// Values \u200b\u200bin 1C 8.3, 8.2 & Clause Procedure Assess the alternate notebook (command) color \u003d new list of accommodation; Colors. Add ("red"); Colors. Add ("green"); Colors. Add ("blue"); // The post note procedure is defined slightly below RecordsMelectsmethelements \u003d New Description ( "PastaMelements", This object); Colors. Showcase elements (notifying elements, elements, "Choose your favorite colors" ); Colors. Fuelings (truth); End Controlments & Complaint Procedure Preparations Elements (Elements, Parameters) Export If Elements<> It is uncertain then for each color from the elements of the cycle if color. Mark then report (color. Value); Ended; EndCycle; Ended; Extrudresses /// How to make a modal choice of value from the list in 1C 8.3, 8.2 & Clause Procedure AssessingModal Education (Team) Colors \u003d New Snaps; Colors. Add ("red"); Colors. Add ("green"); Colors. Add ("blue"); Welcome \u003d colors. Select element ( "Choose your favorite color"); If chinvat<> It is uncertain then to report (WILL. VALUE); Ended; Extrudresses /// How to make a modal mark of values \u200b\u200bfrom the list /// Values \u200b\u200bin 1C 8.3, 8.2 & Clause Procedure As far asomodalTextooms (command) color \u003d new list of accommodation; Colors. Add ("red"); Colors. Add ("green"); Colors. Add ("blue"); If colors. Character elements ( "Choose your favorite colors") Then for each color from the color cycle if color. Mark then report (color. Value); Ended; EndCycle; Ended; // And so you can install all marks // List to a certain meaning Colors. Fuelings (truth); Extrudresses /// download and execute these examples on the computer

Frequently important when you need to limit the data types available to select when editing the list of values. If, by the terms of the task, it is known that the list of values \u200b\u200bwill contain only one specific type data, it makes sense to limit the available types. Otherwise, the user when editing is forced to independently choose the type of all available in the configuration, which is inconvenient.

For this purpose, there is a "Type of Value". However, if we want to display a table (or field) associated with the requisite of the object (not forms), this property will not be in the palette of the properties. What to do?

Consider the example in which we want to display the value of the selection of the report option. We will have one element of the selection, with the type of comparison "in the list", so it is impractical for the form of a standard selection of data layout. To do this, create a new report props with the type "list of values", through it will control the setting of the layout. But the report requisite does not have the "Type of Value" properties.

Create another props on the form with the type of "list of values". He will already have this property. Select the type of data in this property in this property and derive this props on the form.

Do you have a question, do you need a consultant help?

Now we need to configure the synchronization of the requisite of the form and the details of the report. In this case, the module code of the module will look as follows:

I note that the transfer of the elements of the list one in the cycle is not done by chance. If you write

Etform. Designation \u003d elementatub. The definition;

by analogy with

Report testing \u003d elementotor. The definition;

it will not give the desired effect, because In this case, the entire list is copied, with all properties, including with the "Type of value" property, which is not filled with the element collection. Thus, the type of value is displayed by us will be reset.



Did you like the article? Share it