<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: iCode – код параметра, выводимого в колонке]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме iCode – код параметра, выводимого в колонке форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Wed, 20 May 2026 13:39:54 +0300</pubDate>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message56265/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Нет не стал я этим окном заниматься пусть в квике будет <br />
			<i>20.06.2021 13:14:27, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message56265/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message56265/topic6454/</guid>
			<pubDate>Sun, 20 Jun 2021 13:14:27 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55815/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Можно поднять тему? Вопрос собственно по <B>w32.dll</B>,<br />вот такой код запросто находит окно QUIK:<br />
====code====
<pre>w32=nil
w32 = require ("w32")
hWnd = 0
function main(&nbsp;&nbsp;)
hWnd = w32.FindWindow("InfoClass","")
message("hWnd= "..tostring(hWnd),1)
hWnd = w32.FindWindow("Robo","")
message("hWnd= "..tostring(hWnd),1)
end
</pre>
=============
<p>Но мой &quot;Robo&quot; = 0! Проверял Spy++. Help me! <a class="blog-p-user-name" id="bp_9b7g34eY" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, у Вас получилось PostMessage?</p> <br />
			<i>26.05.2021 10:46:58, Alex.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55815/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55815/topic6454/</guid>
			<pubDate>Wed, 26 May 2021 10:46:58 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55276/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_ixYAE72U" href="/user/14644/" bx-tooltip-user-id="14644">Артем</a> написал:<br /> Владимир , было бы уместно в таком случае делать "безголовый" клиент, который по локалхосту может отправлять данные в браузер - а как пользователи будут их отображать это будет их личное дело. <br />=============<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_m4fX1fD1" href="/user/14644/" bx-tooltip-user-id="14644">Артем</a> написал:<br /> Артем , Да, "уместно в таком случае делать "безголовый" клиент", который будет принимать от юзеров заявки и давать им квитанции об их исполнении или отклонении. Это БАЗОВЫЙ уровень Квика.<br />=============<br /> <br /> &nbsp;Коротко, четко, практически манифест для разработчиков QUIK. <br />------<br /> &nbsp;Глядя, на такие комментарии, мне хочет завершить мой конфликт с swerg. На самом деле, он старается помочь многим пользователям форума, Кроме того, он выкладывает свои профессиональные разработки, полезные многим пользователям. <br />
			<i>02.05.2021 22:48:21, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55276/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55276/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 22:48:21 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55269/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_Oj5oCWx4" href="/user/14644/" bx-tooltip-user-id="14644">Артем</a>, Да, &quot;уместно в таком случае делать &quot;безголовый&quot; клиент&quot;, который будет принимать от юзеров заявки и давать им квитанции об их исполнении или отклонении. Это БАЗОВЫЙ уровень Квика. Ну, а дать ему дополнительно программный сервис или всякие там таблицы с графиками - это уже конкуренция между разработчиками софта для привлечения клиентов. В любом случае, базовый сервис должен работать БЕЗУКОРИЗНЕННО (по крайней мере, начиная с версии 1.1.1.3). А прочие свистелки и перделки&quot; - это уже имеет значение только при обеспечении этого условия. А на деле что? <br />
			<i>02.05.2021 11:37:35, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55269/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55269/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 11:37:35 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55267/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_ME2dqdof" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a>, было бы уместно в таком случае делать &quot;безголовый&quot; клиент, который по локалхосту может отправлять данные в браузер - а как пользователи будут их отображать это будет их личное дело. Как раз можно было бы делать скины, дополнительные данные отображать, с помощью WebGL рисовать, и прочие свистелки и перделки задействовать. <br />
			<i>02.05.2021 11:26:39, Артем.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55267/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55267/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 11:26:39 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55265/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_KLQ7uc3X" href="/user/14644/" bx-tooltip-user-id="14644">Артем</a>, Во-первых, западные программисты ничем не лучше наших - был знаком лично с немалым их количеством, в т.ч. с виртуозами, в т.ч. с лучшим программистом мира 1993 года. Во-вторых, вопрос должен быть переформулирован как &quot;вывесить ДАННЫЕ таблицы за пределы окна квика&quot;, и он достаточно легко может быть реализован. В-третьих, основная задача Квика - организация надёжной торговли ценными бумагами, и чем меньше он будет уметь ВНЕ этой задачи - тем лучше! <br />
			<i>02.05.2021 11:09:12, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55265/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55265/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 11:09:12 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55264/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_EleJSX6e" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a>, действительно. Опять я наивно полагал что сделано по-человечески а не через задницу - разбалован совсем западными программистами видимо. 😐 <br /><br />Вопрос стоит в том, чтобы программно вывесить таблицу за пределы окна квика, и таковой функционал на стороне Lua начисто отсутствует. Если вручную его вытащить, то потом можно координаты ставить как угодно, но если этого не сделать, то таблица будет просто двигаться внутри окна квика и просто делать километровые скролбары. Тут вообще имел бы смысл чтобы квик работал в многооконном режиме, а не заталкивал все окошки в главное окно. <br />
			<i>02.05.2021 11:00:46, Артем.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55264/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55264/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 11:00:46 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55263/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_Vx1znh1R" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, Вот уж что меня ВААПЩЕ не интересует! Но если очень хочется - способ один: переместить туда необходимые ДАННЫЕ и там снова делать с ними, что хошь. Причём ЛЮБЫЕ данные, а не только сраную таблицу. Тем более, что сервис для визуализации в Квике достаточно убогий. <br />
			<i>02.05.2021 10:50:29, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55263/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55263/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 10:50:29 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55262/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Нет это все не то, Вы не поняли то что мне надо)), мой вопрос лежит в области визуализации и размещения таблицы (окна) Quik созданной из Lua. Думаю тут надо использовать w32.dll для автоматизации переноса окна таблицы за пределы квика, методом отсылки сообщений типа &nbsp;этому окну<br />C++<br />BOOL PostMessageA( &nbsp; HWND &nbsp; hWnd, &nbsp; UINT &nbsp; Msg, &nbsp; WPARAM wParam, &nbsp; LPARAM lParam ); <br />
			<i>02.05.2021 10:39:53, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55262/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55262/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 10:39:53 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55259/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_EpBdFUEu" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a> написал:<br />Я имел в виду видимую таблицу Quik, созданную из скрипта , которую можно вынести за пределы окна программы на другой монитор например.<br />=============<br /> &nbsp; Может быть вам подойдет следующий вариант.<br /> &nbsp; Вы оформляете функцию создания таблицы QUIK в виде отдельного файла. Далее загружаете этот файл с помощью loadfile &nbsp;в нужный свой скрипт и в нужном месте запускаете байт-код, полученный в loadfile, для создания таблицы QUIK. Это можно делать на любом рабочем месте. <br />
			<i>02.05.2021 09:51:43, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55259/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55259/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 09:51:43 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55258/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_zViZjNpl" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, ЗАЧЕМ?! Это же ВАШ скрипт создавал эту таблицу! Следовательно, он всё и знает. Это всего лишь таблица визуализации, она только для юзера, а &quot;настоящие&quot; данные должны храниться в таблицах Lua. У меня (как и у Вас, насколько я вижу) каждая строка таблицы соответствует отдельному тикеру. Вы думаете, зачем у меня невидимый нулевой столбец? Там как раз и хранится &quot;настоящий&quot; идентификатор этого тикера в моей Lua-таблице (точнее, дереве), и все необходимые действия с инструментом я провожу там, и ТОЛЬКО там! И там можно делать с ними, что хошь: &quot;выносить за пределы Quik&quot;, сохранить в файл и т.д. Я сейчас делаю это каждые 5 минут (на случай падения Квика, которые происходят всё чаще).<br /><br />Клава и мышь обрабатываются в прерываниях (коллбеках), установленных по SetTableNotificationCallback. Я, правда, не знаю, есть ли там комбинации с ctrl и alt, но мне пока что хватает мыши и пробела с Enter. <img src="http://forum.quik.ru/upload/main/smiles/5/icon_smile.png" border="0" data-code=":smile:" data-definition="SD" alt=":smile:" style="width:16px;height:16px;" title="С улыбкой" class="bx-smile" /> <br /><br /><a class="blog-p-user-name" id="bp_PIi7c8AL" href="/user/14644/" bx-tooltip-user-id="14644">Артем</a>, ЩАЗ! Что толку от Ваших &quot;идентификаторов, идущих по порядку начиная с 1&quot;? А ну, кликните мышой по заголовку какого-нить столбца! Что случится с Вашими &quot;идентификаторами&quot;? Правильно, Большая Жопа. Обсуждалось тут уже (в т.ч. с моим участием). <br />
			<i>02.05.2021 09:28:11, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55258/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55258/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 09:28:11 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55256/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Вы приводите пример сохранения таблицы Lua в файл и загрузку, это не то.<br /><br />Я имел в виду видимую таблицу Quik, созданную из скрипта , которую можно вынести за пределы окна программы на другой монитор например.Сейчас это доступно для таблиц при помощи ctrl +alt и захвата таблицы мышкой с переносом за область квика, но таблица созданная из Lua не сохраняется в таком положении <br />
			<i>02.05.2021 09:06:51, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55256/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55256/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 09:06:51 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55253/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_kbOnChed" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, что вы имеете ввиду под &quot;вынесена за пределы квика&quot;?<br /><br />Сбросить и загрузить табличные данные нетрудно. Надо только добавлять строки и столбцы с идентификаторами идущими по порядку начиная с 1.<br /><br />
====code====
<pre>local function savetable ( tbl, fname, separator )
&nbsp;&nbsp;&nbsp;&nbsp;local file, errmsg = io.open ( fname, "w" )
&nbsp;&nbsp;&nbsp;&nbsp;if not file then error ( errmsg ) end

&nbsp;&nbsp;&nbsp;&nbsp;local nr, nc = GetTableSize ( tbl )
&nbsp;&nbsp;&nbsp;&nbsp;if not nr or not nc then error ( "Invalid table handler: " .. tostring ( tbl ) ) end

&nbsp;&nbsp;&nbsp;&nbsp;if not separator then separator = "," end
&nbsp;&nbsp;&nbsp;&nbsp;local replace = "&#92;&#92;" .. separator

&nbsp;&nbsp;&nbsp;&nbsp;local data = { }
&nbsp;&nbsp;&nbsp;&nbsp;for r = 1, nr do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for c = 1, nc do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local v = GetCell ( tbl, r, c )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data&#91; #data + 1 &#93; = tostring ( v.value == 0 and v.image or tostring ( v.value ) ):gsub ( separator, replace )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data&#91; #data + 1 &#93; = separator
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data&#91; #data &#93; = "&#92;n"
&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;file:write ( table.concat ( data ) )
&nbsp;&nbsp;&nbsp;&nbsp;file:close ( )
end

local function loadtable ( tbl, fname, separator )
&nbsp;&nbsp;&nbsp;&nbsp;local file, errmsg = io.open ( fname, "r" )
&nbsp;&nbsp;&nbsp;&nbsp;if not file then error ( errmsg ) end

&nbsp;&nbsp;&nbsp;&nbsp;local nr, nc = GetTableSize ( tbl )
&nbsp;&nbsp;&nbsp;&nbsp;if not nr or not nc then error ( "Invalid table handler: " .. tostring ( tbl ) ) end

&nbsp;&nbsp;&nbsp;&nbsp;if not separator then separator = "," end
&nbsp;&nbsp;&nbsp;&nbsp;local replace = "&#92;&#92;" .. separator
&nbsp;&nbsp;&nbsp;&nbsp;local pattern =&nbsp;&nbsp;"&#91;^" .. separator .. "&#93;*"

&nbsp;&nbsp;&nbsp;&nbsp;local r, c= 0, 0
&nbsp;&nbsp;&nbsp;&nbsp;for line in file:lines ( ) do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c = 0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r = r + 1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for tok in line:gmatch ( pattern ) do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;col = col + 1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tok = tok:gsub ( replace, separator )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local num = tonumber ( tok )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if num then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetCell ( tbl, r, c, tok, num )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SetCell ( tbl, r, c, tok )
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;end
end</pre>
============= <br />
			<i>02.05.2021 03:49:08, Артем.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55253/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55253/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 03:49:08 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55252/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Хотя нет горячие клавиши же есть ctrl +alt но как это автоматизировать? <br />
			<i>02.05.2021 00:45:41, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55252/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55252/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 00:45:41 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55251/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Я правильно понимаю, что созданную таблицу нельзя сохранить вынесенной за пределы Quik ? <br /><br />В принципе координаты и размер таблицы можно сохранить в файл, но она не сможет быть вынесена за пределы окна квик, так или есть какой то способ? <br />
			<i>02.05.2021 00:39:50, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55251/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55251/topic6454/</guid>
			<pubDate>Sun, 02 May 2021 00:39:50 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55249/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Выкладываю те самые файлы из документации так как потратил на их копирование из pdf кучу времени, может хоть кому то удастся его сэкономить<br /><br /><table class="forum-spoiler"><thead onclick="if (this.nextSibling.style.display=='none') { this.nextSibling.style.display=''; BX.addClass(this, 'forum-spoiler-head-open'); } else { this.nextSibling.style.display='none'; BX.removeClass(this, 'forum-spoiler-head-open'); } BX.onCustomEvent('BX.Forum.Spoiler:toggle', [{node: this}]); event.stopPropagation();"><tr><th><div>Скрытый текст</div></th></tr></thead><tbody class="forum-spoiler" style="display:none;"><tr><td>--table_object.lua<br />dofile (getScriptPath() .. &quot;\\quik_table_wrapper.lua&quot;)<br />dofile (getScriptPath() .. &quot;\\ntime.lua&quot;)<br />stopped = false<br />function format1(data)<br />return string.format(&quot;0x%08X&quot;, data)<br />end<br />function format2(data)<br />return string.format(&quot;%06d&quot;, data)<br />end<br />function OnStop(s)<br />stopped = true<br />end<br />function main()<br />-- поворачивающиеся «палочки» в заголовке таблицы<br />local palochki = {&quot;-&quot;,&quot;\\&quot;, &quot;|&quot;, &quot;/&quot;}<br />-- создать экземпляр QTable<br />t = QTable.new()<br />if not t then<br />message(&quot;error!&quot;, 3)<br />return<br />else<br />message(&quot;table with id = &quot; ..t.t_id .. &quot; created&quot;, 1)<br />end<br />-- добавить два столбца с функциями форматирования<br />-- в первом столбце – hex-значения, во втором – целые числа<br />t:AddColumn(&quot;test1&quot;, QTABLE_INT_TYPE, 10,format1)<br />t:AddColumn(&quot;test2&quot;, QTABLE_INT_TYPE, 10, format2)<br />-- добавить столбцы без форматирования<br />t:AddColumn(&quot;test3&quot;, QTABLE_CACHED_STRING_TYPE, 50)<br />t:AddColumn(&quot;test4&quot;, QTABLE_TIME_TYPE, 50)<br />t:AddColumn(&quot;test5&quot;, QTABLE_CACHED_STRING_TYPE, 50)<br />t:SetCaption(&quot;Test&quot;)<br />t:Show()<br />i=1<br />-- исполнять цикл, пока пользователь не остановит скрипт из диалога управления<br />while not stopped do<br />-- если таблица закрыта, то показать ее заново<br />-- при этом все предыдущие данные очищаются<br />if t:IsClosed() then<br />t:Show()<br />end<br />-- на каждой итерации повернуть «палочку» на 45 градусов<br />t:SetCaption(&quot;QLUA TABLE TEST &quot; .. palochki&#91;i%4 +1&#93;)<br />-- метод добавит в таблицу новую строчку и вернет ее номер<br />local row = t:AddLine()<br />t:SetValue(row, &quot;test1&quot;, row, i)<br />t:SetValue(row, &quot;test2&quot;, row, i)<br />-- заполнить ячейку текущим заголовком таблицы<br />-- тип столбца – строковый, поэтому последний параметр пропускается<br />SetCell(t.t_id, row, 3, GetWindowCaption(t.t_id))<br />_date = os.date(&quot;*t&quot;)<br />-- 4-й столбец заполнить данными типа время (число в формате &lt;ЧЧММСС&gt;)<br />-- Функция для строкового представления времени определена в файле<br />--ntime.lua<br />-- Функция NiceTime возвращает строку<br />SetCell(t.t_id, row, 4,NiceTime(_date) .. string.format(&quot; (%02d:%02d:%02d)&quot;, _date.hour,_date.min, _date.sec),_date.hour*10000+_date.min*100 +_date.sec)<br />-- пятый столбец имеет строковый тип и заполняется результатом<br />--выполнения функции NiceTime<br />-- исходный код функции взят из виджета Conky Lua для Ubuntu<br />SetCell(t.t_id, row, 5, NiceTime(_date))<br />sleep(1000)<br />i=i+1<br />end<br />message(&quot;finished&quot;)<br />end </td></tr></tbody></table><br />--quik_table_wrapper.lua <br /><br /><br /><table class="forum-spoiler"><thead onclick="if (this.nextSibling.style.display=='none') { this.nextSibling.style.display=''; BX.addClass(this, 'forum-spoiler-head-open'); } else { this.nextSibling.style.display='none'; BX.removeClass(this, 'forum-spoiler-head-open'); } BX.onCustomEvent('BX.Forum.Spoiler:toggle', [{node: this}]); event.stopPropagation();"><tr><th><div>Скрытый текст</div></th></tr></thead><tbody class="forum-spoiler" style="display:none;"><tr><td><br />-- Перегрузка функции message с необязательным вторым параметром<br />old_message = message<br />function message(v, i)<br />old_message(tostring(v), i or 1)<br />end<br />QTable ={}<br />QTable.__index = QTable<br />-- Создать и инициализировать экземпляр таблицы QTable<br />function QTable.new()<br />local t_id = AllocTable()<br />if t_id ~= nil then<br />q_table = {}<br />setmetatable(q_table, QTable)<br />q_table.t_id=t_id<br />q_table.caption = &quot;&quot;<br />q_table.created = false<br />q_table.curr_col=0<br />-- таблица с описанием параметров столбцов<br />q_table.columns={}<br />return q_table<br />else<br />return nil<br />end<br />end<br />function QTable:Show()<br />-- отобразить в терминале окно с созданной таблицей<br />CreateWindow(self.t_id)<br />if self.caption ~=&quot;&quot; then<br />-- задать заголовок для окна<br />SetWindowCaption(self.t_id, self.caption)<br />end<br />self.created = true<br />end<br />function QTable:IsClosed()<br />-- если окно с таблицей закрыто, возвращает «true»<br />return IsWindowClosed(self.t_id)<br />end<br />function QTable:delete()<br />-- удалить таблицу<br />DestroyTable(self.t_id)<br />end<br />function QTable:GetCaption()<br />if IsWindowClosed(self.t_id) then<br />return self.caption<br />else<br />-- возвращает строку, содержащую заголовок таблицы<br />return GetWindowCaption(self.t_id)<br />end<br />end<br />-- Задать заголовок таблицы<br />function QTable:SetCaption(s)<br />self.caption = s<br />if not IsWindowClosed(self.t_id) then<br />res = SetWindowCaption(self.t_id, tostring(s))<br />end<br />end<br />-- Добавить описание столбца &lt;name&gt; типа &lt;c_type&gt; в таблицу<br />-- &lt;ff&gt; – функция форматирования данных для отображения<br />function QTable:AddColumn(name, c_type, width, ff )<br />local col_desc={}<br />self.curr_col=self.curr_col+1<br />col_desc.c_type = c_type<br />col_desc.format_function = ff<br />col_desc.id = self.curr_col<br />self.columns&#91;name&#93; = col_desc<br />-- &lt;name&gt; используется в качестве заголовка таблицы<br />AddColumn(self.t_id, self.curr_col, name, true, c_type, width)<br />end<br />function QTable:Clear()<br />-- очистить таблицу<br />Clear(self.t_id)<br />end<br />-- Установить значение в ячейке<br />function QTable:SetValue(row, col_name, data)<br />local col_ind = self.columns&#91;col_name&#93;.id or nil<br />if col_ind == nil then<br />return false<br />end<br />-- если для столбца задана функция форматирования, то она используется<br />local ff = self.columns&#91;col_name&#93;.format_function<br />if type(ff) == &quot;function&quot; then<br />-- в качестве строкового представления используется<br />-- результат выполнения функции форматирования<br />SetCell(self.t_id, row, col_ind, ff(data), data)<br />return true<br />else<br />SetCell(self.t_id, row, col_ind, tostring(data), data)<br />end<br />end<br />function QTable:AddLine()<br />-- добавляет в конец таблицы пустую строчку и возвращает ее номер<br />return InsertRow(self.t_id, -1)<br />end<br />function QTable:GetSize()<br />-- возвращает размер таблицы<br />return GetTableSize(self.t_id)<br />end<br />-- Получить данные из ячейки по номеру строки и имени столбца<br />function QTable:GetValue(row, name)<br />local t={}<br />local col_ind = self.columns&#91;name&#93;.id<br />if col_ind == nil then<br />return nil<br />end<br />t = GetCell(self.t_id, row, col_ind)<br />return t<br />end<br />-- Задать координаты окна<br />function QTable:SetPosition(x, y, dx, dy)<br />return SetWindowPos(self.t_id, x, y, dx, dy)<br />end<br />-- Функция возвращает координаты окна<br />function QTable:GetPosition()<br />top, left, bottom, right = GetWindowRect(self.t_id)<br />return top, left, right-left, bottom-top<br />end<br /><br /> <br /><br /><br /></td></tr></tbody></table><br />--ntime.lua<br /><br /><table class="forum-spoiler"><thead onclick="if (this.nextSibling.style.display=='none') { this.nextSibling.style.display=''; BX.addClass(this, 'forum-spoiler-head-open'); } else { this.nextSibling.style.display='none'; BX.removeClass(this, 'forum-spoiler-head-open'); } BX.onCustomEvent('BX.Forum.Spoiler:toggle', [{node: this}]); event.stopPropagation();"><tr><th><div>Скрытый текст</div></th></tr></thead><tbody class="forum-spoiler" style="display:none;"><tr><td>words = {&quot;one &quot;, &quot;two &quot;, &quot;three &quot;, &quot;four &quot;, &quot;five &quot;, &quot;six &quot;, &quot;seven &quot;, &quot;eight &quot;,<br />&quot;nine &quot;}<br />levels = {&quot;thousand &quot;, &quot;million &quot;, &quot;billion &quot;, &quot;trillion &quot;, &quot;quadrillion &quot;,<br />&quot;quintillion &quot;, &quot;sextillion &quot;, &quot;septillion &quot;, &quot;octillion &quot;, &#91;0&#93; = &quot;&quot;}<br />iwords = {&quot;ten &quot;, &quot;twenty &quot;, &quot;thirty &quot;, &quot;forty &quot;, &quot;fifty &quot;, &quot;sixty &quot;, &quot;seventy &quot;,<br />&quot;eighty &quot;, &quot;ninety &quot;}<br />twords = {&quot;eleven &quot;, &quot;twelve &quot;, &quot;thirteen &quot;, &quot;fourteen &quot;, &quot;fifteen &quot;, &quot;sixteen &quot;,<br />&quot;seventeen &quot;, &quot;eighteen &quot;, &quot;nineteen &quot;}<br />function digits(n)<br />local i, ret = -1<br />return function()<br />i, ret = i + 1, n % 10<br />if n &gt; 0 then<br />n = math.floor(n / 10)<br />return i, ret<br />end<br />end<br />end<br />level = false<br />function getname(pos, dig)<br />level = level or pos % 3 == 0<br />if(dig == 0) then return &quot;&quot; end<br />local name = (pos % 3 == 1 and iwords&#91;dig&#93; or words&#91;dig&#93;) .. (pos % 3 == 2 and<br />&quot;hundred &quot; or &quot;&quot;)<br />if(level) then name, level = name .. levels&#91;math.floor(pos / 3)&#93;, false end<br />return name<br />end<br />function numberToWord(number)<br />if(number == 0) then return &quot;zero&quot; end<br />vword = &quot;&quot;<br />for i, v in digits(number) do<br />vword = getname(i, v) .. vword<br />end<br />for i, v in ipairs(words) do<br />vword = vword:gsub(&quot;ty &quot; .. v, &quot;ty-&quot; .. v)<br />vword = vword:gsub(&quot;ten &quot; .. v, twords&#91;i&#93;)<br />end<br />return vword<br />end<br />function _Time(t)<br />hour = t.hour<br />minute = t.min<br />hour = hour % 12<br />if(hour == 0) then<br />hour, nextHourWord = 12, &quot;one &quot;<br />else<br />nextHourWord = numberToWord(hour+1)<br />end<br />hourWord = numberToWord(hour)<br />if(minute == 0 ) then<br />return hourWord .. &quot;o&#39;clock&quot;<br />elseif(minute == 30) then<br />return &quot;half past &quot; .. hourWord<br />elseif(minute == 15) then<br />return &quot;a quarter past &quot; .. hourWord<br />elseif(minute == 45) then<br />return &quot;a quarter to &quot; .. nextHourWord<br />else<br />if(minute &lt; 30) then<br />return numberToWord(minute) .. &quot;past &quot; .. hourWord<br />else<br />return numberToWord(60-minute) .. &quot;to &quot; .. nextHourWord<br />end<br />end<br />end<br />function _Seconds(s)<br />return numberToWord(s)<br />end<br />function NiceTime(t)<br />return _Time(t) ..&quot;and &quot;.. _Seconds(t.sec) .. &quot;second&quot;<br />end </td></tr></tbody></table><br />--x0x.lua<br /><br /><table class="forum-spoiler"><thead onclick="if (this.nextSibling.style.display=='none') { this.nextSibling.style.display=''; BX.addClass(this, 'forum-spoiler-head-open'); } else { this.nextSibling.style.display='none'; BX.removeClass(this, 'forum-spoiler-head-open'); } BX.onCustomEvent('BX.Forum.Spoiler:toggle', [{node: this}]); event.stopPropagation();"><tr><th><div>Скрытый текст</div></th></tr></thead><tbody class="forum-spoiler" style="display:none;"><tr><td>--Пример реализации игры «Крестики-нолики»<br />--&#91;&#91; TIC-TAC-TOE<br />by Evan Hahn (<noindex><a href="http://evanhahn.com/how-to-code-tic-tac-toe-and-a-lua-implementation/" target="_blank" rel="nofollow">http://evanhahn.com/how-to-code-tic-tac-toe-and-a-lua-implementation/</a></noindex><br />--&#93;&#93;<br />----------------------------------------------<br />-- Configuration (change this if you wish!) --<br />----------------------------------------------<br />t_id=nil --grid<br />-- Are they playable by human or computer-controlled?<br />PLAYER_1_HUMAN = true<br />PLAYER_2_HUMAN = false<br />-- Board size<br />BOARD_RANK = 3 -- The board will be this in both dimensions.<br />-- Display stuff<br />PLAYER_1 = &quot;&#91;x&#93;&quot; -- Player 1 is represented by this. Player 1 goes first.<br />PLAYER_2 = &quot;&#91;o&#93;&quot; -- Player 2 is represented by this.<br />EMPTY_SPACE = &quot;&#91; &#93;&quot; -- An empty space is displayed like this.<br />DISPLAY_HORIZONTAL_SEPARATOR = &quot;-&quot; -- Horizontal lines look like this.<br />DISPLAY_VERTICAL_SEPARATOR = &quot; | &quot; -- Vertical lines look like this<br />--&#91;&#91; ###################################################################<br />#### Don&#39;t mess with things below here unless you are brave ####<br />################################################################### --&#93;&#93;<br />------------------------<br />-- More configuration --<br />------------------------<br />MAX_BOARD_RANK = 100 -- Won&#39;t run above this number. Prevents crashes.<br />-------------------------------------------------------<br />-- Don&#39;t run if the board is larger than the maximum --<br />-------------------------------------------------------<br />if BOARD_RANK &gt; MAX_BOARD_RANK then os.exit(0) end<br />-----------------------------<br />-- Create board (2D table) --<br />-----------------------------<br />space = {}<br />for i = 0, (BOARD_RANK - 1) do<br />space&#91;i&#93; = {}<br />for j = 0, (BOARD_RANK - 1) do<br />space&#91;i&#93;&#91;j&#93; = nil -- start each space with nil<br />end<br />end<br />---------------------<br />-- Board functions --<br />---------------------<br />-- get the piece at a given spot<br />function getPiece(x, y)<br />return space&#91;x&#93;&#91;y&#93;<br />end<br />-- get the piece at a given spot; if nil, return &quot; &quot;<br />-- this is useful for output.<br />function getPieceNoNil(x, y)<br />if getPiece(x, y) ~= nil then<br />return getPiece(x, y)<br />else<br />return EMPTY_SPACE<br />end<br />end<br />-- is that space empty?<br />function isEmpty(x, y)<br />if getPiece(x, y) == nil then<br />return true<br />else<br />return false<br />end<br />end<br />-- place a piece there, but make sure nothing is there already.<br />-- if you can&#39;t play there, return false.<br />function placePiece(x, y, piece)<br />if isEmpty(x, y) == true then<br />space&#91;x&#93;&#91;y&#93; = piece<br />return true<br />else<br />return false<br />end<br />end<br />-- is the game over?<br />function isGameOver()<br />if checkWin() == false then -- if there is no win...<br />for i = 0, (BOARD_RANK - 1) do -- is the board empty?<br />for j = 0, (BOARD_RANK - 1) do<br />if isEmpty(i, j) == true then return false end<br />end<br />end<br />return true<br />else -- there is a win; the game is over<br />return true<br />end<br />end<br />-- create a string made up of a certain number of smaller strings<br />-- this is useful for the display.<br />function repeatString(to_repeat, amount)<br />if amount &lt;= 0 then return &quot;&quot; end<br />local to_return = &quot;&quot;<br />for i = 1, amount do<br />to_return = to_return .. to_repeat<br />end<br />return to_return<br />end<br />-- display the board.<br />-- this uses the configuration file pretty much entirely.<br />function displayBoard()<br />for i = (BOARD_RANK - 1), 0, -1 do<br />for j = 0, (BOARD_RANK - 1) do -- generate that row<br />local piece = getPieceNoNil(j, i)<br />SetCell(t_id, i+1, j+1, piece)<br />end<br />end<br />end<br />-------------------------------------------------<br />-- Create regions (I admit this is a bit ugly) --<br />-------------------------------------------------<br />-- declare region and a number to increment<br />region = {}<br />region_number = 0<br />-- vertical<br />for i = 0, (BOARD_RANK - 1) do<br />region&#91;region_number&#93; = {}<br />for j = 0, (BOARD_RANK - 1) do<br />region&#91;region_number&#93;&#91;j&#93; = {}<br />region&#91;region_number&#93;&#91;j&#93;&#91;&quot;x&quot;&#93; = i<br />region&#91;region_number&#93;&#91;j&#93;&#91;&quot;y&quot;&#93; = j<br />end<br />region_number = region_number + 1<br />end<br />-- horizontal<br />for i = 0, (BOARD_RANK - 1) do<br />region&#91;region_number&#93; = {}<br />for j = 0, (BOARD_RANK - 1) do<br />region&#91;region_number&#93;&#91;j&#93; = {}<br />region&#91;region_number&#93;&#91;j&#93;&#91;&quot;x&quot;&#93; = j<br />region&#91;region_number&#93;&#91;j&#93;&#91;&quot;y&quot;&#93; = i<br />end<br />region_number = region_number + 1<br />end<br />-- diagonal, bottom-left to top-right<br />region&#91;region_number&#93; = {}<br />for i = 0, (BOARD_RANK - 1) do<br />region&#91;region_number&#93;&#91;i&#93; = {}<br />region&#91;region_number&#93;&#91;i&#93;&#91;&quot;x&quot;&#93; = i<br />region&#91;region_number&#93;&#91;i&#93;&#91;&quot;y&quot;&#93; = i<br />end<br />region_number = region_number + 1<br />-- diagonal, top-left to bottom-right<br />region&#91;region_number&#93; = {}<br />for i = (BOARD_RANK - 1), 0, -1 do<br />region&#91;region_number&#93;&#91;i&#93; = {}<br />region&#91;region_number&#93;&#91;i&#93;&#91;&quot;x&quot;&#93; = BOARD_RANK - i - 1<br />region&#91;region_number&#93;&#91;i&#93;&#91;&quot;y&quot;&#93; = i<br />end<br />region_number = region_number + 1<br />----------------------<br />-- Region functions --<br />----------------------<br />-- get a region<br />function getRegion(number)<br />return region&#91;number&#93;<br />end<br />-- check for a win in a particular region.<br />-- returns a number representation of the region. occurrences of player 1<br />-- add 1, occurrences of player 2 subtract 1. so if there are two X pieces,<br />-- it will return 2. one O will return -1.<br />function checkWinInRegion(number)<br />local to_return = 0<br />for i, v in pairs(getRegion(number)) do<br />local piece = getPiece(v&#91;&quot;x&quot;&#93;, v&#91;&quot;y&quot;&#93;)<br />if piece == PLAYER_1 then to_return = to_return + 1 end<br />if piece == PLAYER_2 then to_return = to_return - 1 end<br />end<br />return to_return<br />end<br />-- check for a win in every region.<br />-- returns false if no winner.<br />-- returns the winner if there is one.<br />function checkWin()<br />for i in pairs(region) do<br />local win = checkWinInRegion(i)<br />if math.abs(win) == BOARD_RANK then<br />if win == math.abs(win) then<br />return PLAYER_1<br />else<br />return PLAYER_2<br />end<br />end<br />end<br />return false<br />end<br />------------------<br />-- UI Functions --<br />------------------<br />-- human play<br />function humanPlay(piece)<br />message(&quot;Human turn&quot;)<br />displayBoard()<br />local placed = false<br />while placed == false do -- loop until they play correctly<br />sleep(100)<br />if g_X ~= -1 and g_Y ~=-1 then<br />local x = tonumber(g_Y)-1<br />local y = tonumber(g_X)-1<br />g_X = -1<br />g_Y= -1<br />message(&quot;clicked in &quot; .. x .. &quot; and &quot; .. y)<br />placed = placePiece(x, y, piece)<br />if placed == false then<br />message(&quot;I&#39;m afraid you can&#39;t play there!&quot;)<br />end<br />end<br />end<br />displayBoard()<br />end<br />-- AI play<br />function AIPlay(piece)<br />-- am I negative or positive?<br />local me = 0<br />if piece == PLAYER_1 then me = 1 end<br />if piece == PLAYER_2 then me = -1 end<br />-- look for a region in which I can win<br />for i in pairs(region) do<br />local win = checkWinInRegion(i)<br />if win == ((BOARD_RANK - 1) * me) then<br />for j, v in pairs(getRegion(i)) do<br />if isEmpty(v&#91;&quot;x&quot;&#93;, v&#91;&quot;y&quot;&#93;) == true then<br />placePiece(v&#91;&quot;x&quot;&#93;, v&#91;&quot;y&quot;&#93;, piece)<br />return<br />end<br />end<br />end<br />end<br />-- look for a region in which I can block<br />for i in pairs(region) do<br />local win = checkWinInRegion(i)<br />if win == ((BOARD_RANK - 1) * (me * -1)) then<br />for j, v in pairs(getRegion(i)) do<br />if isEmpty(v&#91;&quot;x&quot;&#93;, v&#91;&quot;y&quot;&#93;) == true then<br />placePiece(v&#91;&quot;x&quot;&#93;, v&#91;&quot;y&quot;&#93;, piece)<br />return<br />end<br />end<br />end<br />end<br />-- play first empty space, if no better option<br />for i = 0, (BOARD_RANK - 1) do<br />for j = 0, (BOARD_RANK - 1) do<br />if placePiece(i, j, piece) ~= false then return end<br />end<br />end<br />end<br />g_X=-1<br />g_Y=-1<br />function event_callback(t_id, msg, par1, par2)<br />if msg == QTABLE_LBUTTONDOWN then<br />g_X = par1<br />g_Y = par2<br />end<br />end<br />old_message = message<br />local fmt = string.format<br />function message(v, t)<br />t= t or 1<br />old_message(tostring(v), t)<br />end<br />function main()<br />t_id = AllocTable()<br />AddColumn(t_id, 1, &quot;&quot;, true, QTABLE_CACHED_STRING_TYPE, 5)<br />AddColumn(t_id, 2, &quot;&quot;, true, QTABLE_CACHED_STRING_TYPE, 5)<br />AddColumn(t_id, 3, &quot;&quot;, true, QTABLE_CACHED_STRING_TYPE, 5)<br />CreateWindow(t_id)<br />for i=1, 3 do<br />row = InsertRow(t_id, -1)<br />SetCell(t_id, row, 1, &quot;&#91; &#93;&quot;)<br />SetCell(t_id, row, 2, &quot;&#91; &#93;&quot;)<br />SetCell(t_id, row, 3, &quot;&#91; &#93;&quot;)<br />end<br />SetTableNotificationCallback(t_id, event_callback)<br />message(&quot;Welcome to Tic-Tac-Toe!&quot;)<br />-- play the game until someone wins<br />while true do<br />sleep(100)<br />-- break if the game is won<br />if isGameOver() == true then<br />break<br />end<br />-- player 1<br />if PLAYER_1_HUMAN == true then<br />humanPlay(PLAYER_1)<br />else<br />AIPlay(PLAYER_1)<br />end<br />if isGameOver() == true then<br />break<br />end<br />if PLAYER_2_HUMAN == true then<br />humanPlay(PLAYER_2)<br />else<br />AIPlay(PLAYER_2)<br />end<br />end<br />-- show the final board<br />displayBoard()<br />-- write who won, or if there is a tie<br />win = checkWin()<br />if win == false then<br />message(&quot;Tie game!\n&quot;)<br />else<br />message(win)<br />message(&quot; wins!\n&quot;)<br />end<br />end<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </td></tr></tbody></table> <br />
			<i>01.05.2021 15:27:13, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55249/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55249/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 15:27:13 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55248/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_KvQwBgnU" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, Ну я уж и не знаю, каким местом можно ТАКОЕ задумывать! <img src="http://forum.quik.ru/upload/main/smiles/5/icon_smile.png" border="0" data-code=":smile:" data-definition="SD" alt=":smile:" style="width:16px;height:16px;" title="С улыбкой" class="bx-smile" /> <br /><br />Для меня в своё время было шоком, что на одно событие приходят несколько прерываний, потом - что они приходят вразнобой, теперь вот это...<br /><br />Да сделать-то многое можно - труднее всего выявить ошибку, исправить на порядок проще. Но мне просто противно обрабатывать подобные глюки - тем более, что они иногда резко усложняют код. Например, удаление несработавших заявок - это просто песня! Хотя я вообще никак не контролирую, сработает KILL_ORDER или нет. И прерывания OnOrder выбросил нафиг, как и подавляющее большинство остальных. <br />
			<i>01.05.2021 14:39:27, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55248/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55248/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 14:39:27 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55247/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			можно ограничение поставить по времени на обработку <br />
			<i>01.05.2021 13:32:42, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55247/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55247/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:32:42 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55246/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			но он присылает вчерашние сделки вечерней сессии наверно, так задумано наверно <br />
			<i>01.05.2021 13:31:59, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55246/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55246/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:31:59 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55245/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_joPxAgi4" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, Нет, всё намного хуже. &nbsp;<img src="http://forum.quik.ru/upload/main/smiles/5/icon_smile.png" border="0" data-code=":smile:" data-definition="SD" alt=":smile:" style="width:16px;height:16px;" title="С улыбкой" class="bx-smile" /> У меня четверть, если не треть всего кода посвящена именно компенсации различных глюков. Из непобеждённых остался такой: при обрыве и восстановлении связи эта скотина присылает целую колоду прерываний OnTrade,некоторые из которых были исполнены ещё вчера! <br />
			<i>01.05.2021 13:28:59, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55245/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55245/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:28:59 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55243/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_FE1dHqkF" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br /><noindex><a href="/user/14481/" target="_blank" rel="nofollow">Евгений</a></noindex>, Вот уж извините! Это источник ТАКИХ глюков, с которыми Вы потом в жисть не разберётесь! Я даже при изменении строк в таблице перебиваю её заново ( Clear + InsertRow)! А при пропадании текста в таблице и вообще приходится делать DestroyTable + AllocTable!<br />=============<br />Неужели все так плохо?)) <br />
			<i>01.05.2021 13:22:48, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55243/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55243/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:22:48 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55242/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_hWo6otO6" href="/user/82/" bx-tooltip-user-id="82">swerg</a> написал:<br /> <br />====quote====<br /><noindex><a href="/user/14481/" target="_blank" rel="nofollow">Евгений</a></noindex> написал:<br />Справка конечно так себе, примеров мало<br />=============<br /> <br /> <noindex><a href="https://arqatech.com/ru/support/files/" target="_blank" rel="nofollow">https://arqatech.com/ru/support/files/</a></noindex> <br />Документация по языку LUA в QUIK и примерыzip, 4.3 МБ<br /> <noindex><a href="https://arqatech.com/upload/iblock/194/quik_lua.zip" target="_blank" rel="nofollow">https://arqatech.com/upload/iblock/194/quik_lua.zip</a></noindex> <br />&quot;Интерпретатор языка Lua.pdf&quot;<br />=============<br />Вот Спасибо! <br />
			<i>01.05.2021 13:19:38, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55242/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55242/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:19:38 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55241/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_F5aHcC8x" href="/user/82/" bx-tooltip-user-id="82">swerg</a> написал:<br />"Интерпретатор языка Lua.pdf"<br />=============<br />стр. 112<br /><br />форум просто звиздец, в любой момент написание сообщения прекращается - и всё. и только отправить можно, ничего не добавить<br />впрочем весь QUIK такой <br />
			<i>01.05.2021 13:10:54, swerg.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55241/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55241/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:10:54 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55240/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_GYvMW6b4" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, Вот уж извините! Это источник ТАКИХ глюков, с которыми Вы потом в жисть не разберётесь! Я даже при изменении строк в таблице перебиваю её заново ( Clear + InsertRow)! А при пропадании текста в таблице и вообще приходится делать DestroyTable + AllocTable! <br />
			<i>01.05.2021 13:10:26, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55240/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55240/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:10:26 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55239/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_5e0IjR4D" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a> написал:<br />Справка конечно так себе, примеров мало<br />=============<br /><br /><noindex><a href="https://arqatech.com/ru/support/files/" target="_blank" rel="nofollow">https://arqatech.com/ru/support/files/</a></noindex><br />Документация по языку LUA в QUIK и примерыzip, 4.3 МБ<br /><noindex><a href="https://arqatech.com/upload/iblock/194/quik_lua.zip" target="_blank" rel="nofollow">https://arqatech.com/upload/iblock/194/quik_lua.zip</a></noindex><br />"Интерпретатор языка Lua.pdf" <br />
			<i>01.05.2021 13:09:39, swerg.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55239/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55239/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:09:39 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55238/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Для того что бы была возможность вставлять новые колонки без переделки всей таблицы лучше нумерацию делать через 10, чтобы можно было добавлять 11,12, колонки например <br />
			<i>01.05.2021 13:01:48, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55238/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55238/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 13:01:48 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55237/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Аа вон как, просто ширину 0 сделать <br />
			<i>01.05.2021 12:59:16, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55237/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55237/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 12:59:16 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55236/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Спасибо! <br />
			<i>01.05.2021 12:58:06, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55236/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55236/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 12:58:06 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55235/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_PwaGexgH" href="/user/14481/" bx-tooltip-user-id="14481">Евгений</a>, Ничего подобного! Я невидимые столбцы создаю сам - они не для юзера, а для самого скрипта. Вот так:<br /> AddColumn(T,0,&quot;&quot;,true,QTABLE_STRING_TYPE,0);<br /> AddColumn(T,1,&quot;Тикер&quot;,true,QTABLE_STRING_TYPE,8);<br />... <br />
			<i>01.05.2021 12:56:57, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55235/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55235/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 12:56:57 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>iCode – код параметра, выводимого в колонке</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message55234/topic6454/">iCode – код параметра, выводимого в колонке</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Справка конечно так себе, примеров мало <br />
			<i>01.05.2021 12:56:06, Евгений.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message55234/topic6454/</link>
			<guid>http://forum.quik.ru/messages/forum10/message55234/topic6454/</guid>
			<pubDate>Sat, 01 May 2021 12:56:06 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
