Плагин для работы с коллекцией - список (массивы)
Версия: 1.0
Дата релиза: July 30, 2023
Действие создаёт новый пустой экземпляр коллекции.
Описание возврата: Новый список
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('new_list_collection');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "pig");
echo $collectionsarray->list_to_string($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('new_list_collection')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "pig")
echo(`${collectionsarray.list_to_string(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('new_list_collection')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "pig")
print(collectionsarray.list_to_string(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Добавляет указанное значение в конец выбранной коллекции
Описание возврата: Список с добавленным значением
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('add_value_to_list');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "pig");
echo $collectionsarray->list_to_string($array)."\n";
$array = $collectionsarray->add_value_to_list($array, "dog");
$array = $collectionsarray->add_value_to_list($array, "lag");
echo $collectionsarray->list_to_string($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('add_value_to_list')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "pig")
echo(`${collectionsarray.list_to_string(array)}\n`)
array = collectionsarray.add_value_to_list(array, "dog")
array = collectionsarray.add_value_to_list(array, "lag")
echo(`${collectionsarray.list_to_string(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('add_value_to_list')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "pig")
print(collectionsarray.list_to_string(array))
array = collectionsarray.add_value_to_list(array, "dog")
array = collectionsarray.add_value_to_list(array, "lag")
print(collectionsarray.list_to_string(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие копирует часть списка обозначенной длины, начиная с указанного индекса, исключая крайнее значение в этих рамках, и возвращает ее как новый список
Описание возврата: Новый список
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('copy_part_list');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "grape");
$array = $collectionsarray->add_value_to_list($array, "kiwi");
echo $collectionsarray->list_to_string($array)."\n";
$new_array = $collectionsarray->copy_part_list($array, 1, 3);
echo $collectionsarray->list_to_string($new_array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('copy_part_list')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "grape")
array = collectionsarray.add_value_to_list(array, "kiwi")
echo(`${collectionsarray.list_to_string(array)}\n`)
new_array = collectionsarray.copy_part_list(array, 1, 3)
echo(`${collectionsarray.list_to_string(new_array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('copy_part_list')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "grape")
array = collectionsarray.add_value_to_list(array, "kiwi")
print(collectionsarray.list_to_string(array))
new_array = collectionsarray.copy_part_list(array, 1, 3)
print(collectionsarray.list_to_string(new_array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие вставляет коллекцию в список по индексу
Описание возврата: Результирующий список
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('insert_collection_at_index');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array1 = $collectionsarray->new_list_collection();
$array1 = $collectionsarray->add_value_to_list($array1, "kiwi");
$array1 = $collectionsarray->add_value_to_list($array1, "12");
$new_array = $collectionsarray->insert_collection_at_index($array, 1, $array1);
echo $collectionsarray->list_to_string($new_array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('insert_collection_at_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "kiwi")
array1 = collectionsarray.add_value_to_list(array1, "12")
new_array = collectionsarray.insert_collection_at_index(array, 1, array1)
echo(`${collectionsarray.list_to_string(new_array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('insert_collection_at_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "kiwi")
array1 = collectionsarray.add_value_to_list(array1, "12")
new_array = collectionsarray.insert_collection_at_index(array, 1, array1)
print(collectionsarray.list_to_string(new_array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие соединяет две коллекции в установленном порядке.
Описание возврата: Новый список созданный из двух
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('merge_collections');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array1 = $collectionsarray->new_list_collection();
$array1 = $collectionsarray->add_value_to_list($array1, "kiwi");
$array1 = $collectionsarray->add_value_to_list($array1, "12");
$new_array = $collectionsarray->merge_collections($array, $array1);
echo $collectionsarray->list_to_string($new_array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('merge_collections')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "kiwi")
array1 = collectionsarray.add_value_to_list(array1, "12")
new_array = collectionsarray.merge_collections(array, array1)
echo(`${collectionsarray.list_to_string(new_array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('merge_collections')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "kiwi")
array1 = collectionsarray.add_value_to_list(array1, "12")
new_array = collectionsarray.merge_collections(array, array1)
print(collectionsarray.list_to_string(new_array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие удаляет из списка элементы указанной коллекции
Описание возврата: Пустое значение
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('remove_elements');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "kiwi");
$array = $collectionsarray->add_value_to_list($array, "12");
$array1 = $collectionsarray->new_list_collection();
$array1 = $collectionsarray->add_value_to_list($array1, "apple");
$array1 = $collectionsarray->add_value_to_list($array1, "orange");
$array1 = $collectionsarray->add_value_to_list($array1, "12");
$collectionsarray->remove_elements($array, $array1);
echo $collectionsarray->list_to_string($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('remove_elements')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "apple")
array1 = collectionsarray.add_value_to_list(array1, "orange")
array1 = collectionsarray.add_value_to_list(array1, "12")
collectionsarray.remove_elements(array, array1)
echo(`${collectionsarray.list_to_string(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('remove_elements')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "apple")
array1 = collectionsarray.add_value_to_list(array1, "orange")
array1 = collectionsarray.add_value_to_list(array1, "12")
collectionsarray.remove_elements(array, array1)
print(collectionsarray.list_to_string(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие удаляет элементы коллекции в заданном диапазоне
Описание возврата: Новый список, из которого удалены соответствующие элементы
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('remove_range');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "kiwi");
$array = $collectionsarray->add_value_to_list($array, "12");
$new_array = $collectionsarray->remove_range($array, 1, 4);
echo $collectionsarray->list_to_string($new_array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('remove_range')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
new_array = collectionsarray.remove_range(array, 1, 4)
echo(`${collectionsarray.list_to_string(new_array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('remove_range')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
new_array = collectionsarray.remove_range(array, 1, 4)
print(collectionsarray.list_to_string(new_array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие меняет порядок элементов в указанном списке на противоположный
Описание возврата: Пустое значение
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('reverse');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "kiwi");
$array = $collectionsarray->add_value_to_list($array, "12");
$collectionsarray->reverse($array);
echo $collectionsarray->list_to_string($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('reverse')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
collectionsarray.reverse(array)
echo(`${collectionsarray.list_to_string(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('reverse')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
collectionsarray.reverse(array)
print(collectionsarray.list_to_string(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие заменяет значение в списке по индексу
Описание возврата: Пустое значение
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('replace_at_index');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "kiwi");
$array = $collectionsarray->add_value_to_list($array, "12");
$collectionsarray->replace_at_index($array, 1, "new");
echo $collectionsarray->list_to_string($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('replace_at_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
collectionsarray.replace_at_index(array, 1, "new")
echo(`${collectionsarray.list_to_string(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('replace_at_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
collectionsarray.replace_at_index(array, 1, "new")
print(collectionsarray.list_to_string(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Сортирует коллекцию в указанном порядке
Описание возврата: Новый отсортированный список
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('sort');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "kiwi");
$array = $collectionsarray->add_value_to_list($array, "12");
$sort_list = $collectionsarray->sort($array);
echo $collectionsarray->list_to_string($array)."\n";
$sort_list = $collectionsarray->sort($array, $false);
echo $collectionsarray->list_to_string($array)."\n";
$array1 = $collectionsarray->new_list_collection();
$array1 = $collectionsarray->add_value_to_list($array1, "254");
$array1 = $collectionsarray->add_value_to_list($array1, "11");
$array1 = $collectionsarray->add_value_to_list($array1, "1456");
$array1 = $collectionsarray->add_value_to_list($array1, "75");
$array1 = $collectionsarray->add_value_to_list($array1, "16");
$sort_list = $collectionsarray->sort($array1);
echo $collectionsarray->list_to_string($array1)."\n";
$sort_list = $collectionsarray->sort($array1, $false);
echo $collectionsarray->list_to_string($array1)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('sort')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
sort_list = collectionsarray.sort(array)
echo(`${collectionsarray.list_to_string(array)}\n`)
sort_list = collectionsarray.sort(array, false)
echo(`${collectionsarray.list_to_string(array)}\n`)
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "254")
array1 = collectionsarray.add_value_to_list(array1, "11")
array1 = collectionsarray.add_value_to_list(array1, "1456")
array1 = collectionsarray.add_value_to_list(array1, "75")
array1 = collectionsarray.add_value_to_list(array1, "16")
sort_list = collectionsarray.sort(array1)
echo(`${collectionsarray.list_to_string(array1)}\n`)
sort_list = collectionsarray.sort(array1, false)
echo(`${collectionsarray.list_to_string(array1)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('sort')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "kiwi")
array = collectionsarray.add_value_to_list(array, "12")
sort_list = collectionsarray.sort(array)
print(collectionsarray.list_to_string(array))
sort_list = collectionsarray.sort(array, false)
print(collectionsarray.list_to_string(array))
array1 = collectionsarray.new_list_collection()
array1 = collectionsarray.add_value_to_list(array1, "254")
array1 = collectionsarray.add_value_to_list(array1, "11")
array1 = collectionsarray.add_value_to_list(array1, "1456")
array1 = collectionsarray.add_value_to_list(array1, "75")
array1 = collectionsarray.add_value_to_list(array1, "16")
sort_list = collectionsarray.sort(array1)
print(collectionsarray.list_to_string(array1))
sort_list = collectionsarray.sort(array1, false)
print(collectionsarray.list_to_string(array1))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие получает количество элементов в коллекции или массиве
Описание возврата: Количество элементов в списке
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('get_length_of_list');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
echo $collectionsarray->get_length_of_list($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('get_length_of_list')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
echo(`${collectionsarray.get_length_of_list(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('get_length_of_list')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
print(collectionsarray.get_length_of_list(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие проверяет, содержит ли выбранная коллекция указанный объект
Описание возврата: Булевое значение (true - содержит, false - не содержит)
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('contains_value');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "pig");
$array = $collectionsarray->add_value_to_list($array, "dog");
$array = $collectionsarray->add_value_to_list($array, "lag");
echo $collectionsarray->list_to_string($array)."\n";
echo $collectionsarray->contains_value($array,"dog")."\n";
echo $collectionsarray->contains_value($array,"1")."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('contains_value')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "pig")
array = collectionsarray.add_value_to_list(array, "dog")
array = collectionsarray.add_value_to_list(array, "lag")
echo(`${collectionsarray.list_to_string(array)}\n`)
echo(`${collectionsarray.contains_value(array,"dog")}\n`)
echo(`${collectionsarray.contains_value(array,"1")}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('contains_value')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "pig")
array = collectionsarray.add_value_to_list(array, "dog")
array = collectionsarray.add_value_to_list(array, "lag")
print(collectionsarray.list_to_string(array))
print(collectionsarray.contains_value(array,"dog"))
print(collectionsarray.contains_value(array,"1"))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие возвращает отсчитываемый от нуля индекс первого вхождения значения в списке
Описание возврата: Числовая переменная, содержащая индекс элемента с указанным значением или -1, если элемент не найден
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('find_first_index');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
echo $collectionsarray->find_first_index($array, "orange")."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('find_first_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
echo(`${collectionsarray.find_first_index(array, "orange")}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('find_first_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
print(collectionsarray.find_first_index(array, "orange"))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие возвращает индекс последнего вхождения элемента в списке
Описание возврата: Числовая переменная, содержащая индекс элемента с указанным значением или -1, если элемент не найден
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('find_last_index');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
echo $collectionsarray->find_last_index($array, "orange")."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('find_last_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
echo(`${collectionsarray.find_last_index(array, "orange")}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('find_last_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
print(collectionsarray.find_last_index(array, "orange"))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие возвращает значение элемента, порядковый номер позиции которого равен указанному.
Описание возврата: Значение соответствующего индекса
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('get_value_by_index');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
$array = $collectionsarray->add_value_to_list($array, "orange");
echo $collectionsarray->get_value_by_index($array, 1)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('get_value_by_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
echo(`${collectionsarray.get_value_by_index(array, 1)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('get_value_by_index')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
array = collectionsarray.add_value_to_list(array, "orange")
print(collectionsarray.get_value_by_index(array, 1))
# конец теста
print('\n<hr><br>')
# выход
app.quit()
Действие для перевода списка в строку (для теста фенкционала плагина)
Описание возврата: Строка из элментов списка
Примеры использования<?php
// инициализация
$xhe_host = '127.0.0.1:7010';
$relative_app_dir = '..\\..\\..\\';
require($relative_app_dir.'Templates/init.php');
include($relative_app_dir.'Templates/_for_tests_.php');
$bUTF8Ver = true;
$PHP_Use_Trought_Shell = true;
// рабочая папка
$script_folder = $debug->get_cur_script_folder();
// отсносительный путь
$app_dir = realpath($script_folder.$relative_app_dir);
// тестовые данные
$test = new _for_tests_($script_folder, $collectionsarray);
// начало теста
$test->echo_header('list_to_string');
$array = $collectionsarray->new_list_collection();
$array = $collectionsarray->add_value_to_list($array, "apple");
$array = $collectionsarray->add_value_to_list($array, "banana");
$array = $collectionsarray->add_value_to_list($array, "orange");
echo $collectionsarray->list_to_string($array)."\n";
// конец теста
echo "\n<hr><br>";
// выход
$app->quit();
?>
// связь с платформой
xhe_host = '127.0.0.1:7014'
_path = require('path')
relative_app_dir = '..\\..\\..\\'
echo = require(_path.join(relative_app_dir, 'Templates JS', 'init.js'))
_for_tests_ = require(_path.join(relative_app_dir, 'Templates JS', '_for_tests_.js'))
// рабочая папка
script_folder = debug.get_cur_script_folder()
// отсносительны йпуть
app_dir = _path.resolve(_path.join(script_folder, relative_app_dir))
// тестовые данные
test = new _for_tests_(script_folder, collectionsarray)
// начало теста
test.echo_header('list_to_string')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
echo(`${collectionsarray.list_to_string(array)}\n`)
// конец теста
echo('\n<hr><br>')
// выход
app.quit()
# дополнительные пути
import sys, os
relative_app_dir = '..\\..\\..\\'
sys.path.append(os.path.join(relative_app_dir, 'Templates PY'))
# связь с платофрмой
xhe_host = '127.0.0.1:7010'
from xweb_human_emulator import *
from _for_tests_ import _for_tests_
# рабочая папка
script_folder = debug.get_cur_script_folder()
# относительный путь
app_dir = os.path.abspath(os.path.join(script_folder, relative_app_dir))
# тестовые данные
test = _for_tests_(script_folder, collectionsarray)
# начало теста
test.echo_header('list_to_string')
array = collectionsarray.new_list_collection()
array = collectionsarray.add_value_to_list(array, "apple")
array = collectionsarray.add_value_to_list(array, "banana")
array = collectionsarray.add_value_to_list(array, "orange")
print(collectionsarray.list_to_string(array))
# конец теста
print('\n<hr><br>')
# выход
app.quit()