Back to questions
JuniorTheoryCommon
What does the program print (lines separated by spaces)?
Остатки = Новый ТаблицаЗначений;
Остатки.Колонки.Добавить("Склад");
Остатки.Колонки.Добавить("Товар");
Для Каждого Склад Из СтрРазделить("А,Б,А", ",") Цикл
НоваяСтрока = Остатки.Добавить();
НоваяСтрока.Склад = Склад;
НоваяСтрока.Товар = "ручка";
КонецЦикла;
Найденные = Остатки.НайтиСтроки(Новый Структура("Склад", "А"));
Найденные[0].Товар = "клей";
Сообщить(Найденные.Количество());
Сообщить(Остатки[0].Товар);2 клей
- Expecting a change to a found row to leave the table alone:
НайтиСтрокиreturns the rows themselves, not copies - Mixing up
НайтиСтрокиandНайти: the first returns an array of every matching row, the second only the first one
- Why does an index on a column speed up
НайтиСтрокиon a large table? - What does
Найтиreturn when no row matches?