<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: Как определить абсолютный путь к исполняемому файлу lua?]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме Как определить абсолютный путь к исполняемому файлу lua? форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Thu, 14 May 2026 21:33:46 +0300</pubDate>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message51188/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_trJ26ccb" href="/user/54/" bx-tooltip-user-id="54">Старатель</a> написал:<br />Без collectgarbage сработает и для финализации.<br />=============<br /><br /> &nbsp;Дело в том, что уборка мусора может быть запущена в скрипте в процессе его работы, до его завершения и если сработает финализатор, то это ошибка. <br />
			<i>18.12.2020 14:26:49, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message51188/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message51188/topic6021/</guid>
			<pubDate>Fri, 18 Dec 2020 14:26:49 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message51185/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_QDh2Ragg" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a> написал:<br />вариант с локальным объявлением &nbsp;gcrunner<br />=============<br />Так __gc вызывается до OnInit<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>
====code====
<pre>local run = true
local tid = nil

local gcrunner = {}
setmetatable(gcrunner, { __gc = function()
&nbsp;&nbsp;if tid then DestroyTable(tid) end
&nbsp;&nbsp;message('__gc', 2)
end })

function OnInit(script_path)
&nbsp;&nbsp;file = io.open(script_path .. ".log", "w")
&nbsp;&nbsp;file:write("OnInit&#92;n")
&nbsp;&nbsp;message("OnInit")
end

function main()
&nbsp;&nbsp;message("main")
&nbsp;&nbsp;tid = AllocTable()
&nbsp;&nbsp;AddColumn(tid, 1, '1', true, QTABLE_INT_TYPE, 1)
&nbsp;&nbsp;CreateWindow(tid)
&nbsp;&nbsp;collectgarbage()
&nbsp;&nbsp;while run do sleep(300) end
end

function OnStop()
&nbsp;&nbsp;run = nil
end</pre>
=============
</td></tr></tbody></table><br />Убираем какую-нибудь строку, например<br />
====code====
<pre>file:write("OnInit&#92;n")</pre>
=============
и срабатывает при вызове collectgarbage. Как-то так.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_AqzE35XO" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a> написал:<br />вариант с локальным объявлением &nbsp;gcrunner &nbsp;не работает в QLua 5.3.5 для финализации скрипта.<br />=============<br />Без collectgarbage сработает и для финализации. <br />
			<i>18.12.2020 14:17:09, Старатель.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message51185/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message51185/topic6021/</guid>
			<pubDate>Fri, 18 Dec 2020 14:17:09 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message51184/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_gpcR0eeM" href="/user/54/" bx-tooltip-user-id="54">Старатель</a> написал:<br />__gc срабатывает до вызова collectgarbage, возможно при автоматической сборке.<br />=============<br /><br /> &nbsp;Мне, кажется, что ваше предположение верное. В своем комментарии с программой, внутри нее я специально отметил, что вариант с локальным объявлением &nbsp;gcrunner &nbsp;не работает в QLua 5.3.5 для финализации скрипта. Вообще то, похоже, это баг. <br />
			<i>18.12.2020 13:54:09, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message51184/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message51184/topic6021/</guid>
			<pubDate>Fri, 18 Dec 2020 13:54:09 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message51181/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_3XOrbp1K" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a> написал:<br /> <br />====quote====<br /><noindex><a href="/user/54/" target="_blank" rel="nofollow">Старатель</a></noindex> написал:<br />Цитата TGB &nbsp;написал:-- collectgarbage () &nbsp;--- &nbsp;Если эту строку раскомментировать и при этом local gcrunner = {}, то при запуске collectgarbage () сработает __gc.<br />Вроде, не срабатывает.<br />=============<br /> &nbsp; Здравствуйте!<br />При этом необходимо, чтобы gcrunner был объявлен локальным: &nbsp; &nbsp; &nbsp; local gcrunner = {}<br />=============<br />__gc срабатывает до вызова collectgarbage, возможно при автоматической сборке. <br />
			<i>18.12.2020 12:29:35, Старатель.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message51181/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message51181/topic6021/</guid>
			<pubDate>Fri, 18 Dec 2020 12:29:35 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message51178/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_Enp2qdNs" href="/user/54/" bx-tooltip-user-id="54">Старатель</a> написал:<br />Цитата TGB &nbsp;написал:-- collectgarbage () &nbsp;--- &nbsp;Если эту строку раскомментировать и при этом local gcrunner = {}, то при запуске collectgarbage () сработает __gc.<br />Вроде, не срабатывает.<br />=============<br /> &nbsp;Здравствуйте!<br />При этом необходимо, чтобы gcrunner был объявлен локальным: &nbsp; &nbsp; &nbsp; local gcrunner = {} <br />
			<i>18.12.2020 10:34:29, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message51178/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message51178/topic6021/</guid>
			<pubDate>Fri, 18 Dec 2020 10:34:29 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message51174/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_EM5fk322" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a> написал:<br />-- collectgarbage () &nbsp;--- &nbsp;Если эту строку раскомментировать и при этом local gcrunner = {}, то при запуске collectgarbage () сработает __gc.<br />=============<br />Вроде, не срабатывает. <br />
			<i>18.12.2020 09:58:27, Старатель.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message51174/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message51174/topic6021/</guid>
			<pubDate>Fri, 18 Dec 2020 09:58:27 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50787/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_K65qHCmR" href="/user/1222/" bx-tooltip-user-id="1222">Anton</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" /> &nbsp; <br />
			<i>05.12.2020 19:11:08, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50787/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50787/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 19:11:08 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50786/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_HiRhFOy6" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br />здесь ИДЕОЛОГИЧЕСКИХ плюх до мамы!<br />=============<br />А выхода два: написать новый идеологически выдержанный квик (займитесь?) или лечить имеющийся, сначала поняв, рэзать ему отростки или это все же ухи.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_vNboe08w" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br />фигнёй заниматься<br />=============<br />Оно все фигня, даже если кажется, что не фигня. На конструктивную фигню арка, глядишь, и патчик сделает, а на вопли &quot;тут все неправильно, все в топку&quot; - нет. <br />
			<i>05.12.2020 19:09:07, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50786/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50786/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 19:09:07 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50785/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Вам не лень фигнёй заниматься, господа? Управление теряется, сраная интерпретируемая функция способна подвесить весь квик, а вы тут с &quot;финализаторами-деструкторами&quot; маетесь, да с collectgarbage воюете. НУ НЕ МОЖЕТ эта хромоногая кляча нормально работать, здесь ИДЕОЛОГИЧЕСКИХ плюх до мамы! Да, делать какие-то телодвижения в OnStop - это маразм, но там, по крайней мере, файлы прекрасно открываются, закрываются и записываются. А что ещё требуется для торгового скрипта? <br />
			<i>05.12.2020 18:24:03, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50785/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50785/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 18:24:03 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50783/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_RfsWvx0N" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a> написал:<br />А если &nbsp;local gcrunner = {} (локальная переменная) то __gc &nbsp;срабатывает при при любом запуске collectgarbage &nbsp;(в том числе, и до завершения скрипта). <br />=============<br />Есть такое. Значит, коллектор не считает объявление переменной ссылкой на нее. Значит, надо глобально ее объявлять или хотя бы иметь где-то ссылку на нее.<br /><br />Насчет функций. Если gcrunner глобальный, то выскочит сообщение, мол используете прибитый файл, а это значит, что io еще не выгружена, это ее сообщение. Получается, файл прибит не в результате выгрузки библиотеки. Я не нашел, чтобы квик явно где-то файлы закрывал или даже чтобы явно выгружал библиотеки, хотя может где и есть. Принимаем как данность. Строго говоря, финализаторы это не деструкторы, никакой порядок их выполнения не гарантируется, так что теоретически все ок, а как практически это обходить, надо думать. <br />
			<i>05.12.2020 17:05:17, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50783/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50783/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 17:05:17 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50781/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Отформатированный код моего комментария:<br /><br />&lt;code&gt;<br /><span class="bx-font" style="font-size:8pt; line-height: normal;">local run = true</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">local tid = nil</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">local file</span><br /><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">--- &nbsp;Создание деструктора &nbsp;скрипта &nbsp;-----</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">gcrunner = {} &nbsp; --- &nbsp;Если &nbsp; gcrunner &nbsp;= {} (глобальная переменная), то &nbsp;__gc срабатывает только по завершению скрипта (обычно это и требуется).</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--- &nbsp;!!! &nbsp;А если &nbsp;local gcrunner = {} (локальная переменная) то __gc &nbsp;срабатывает при при любом запуске collectgarbage &nbsp;(в том числе, и до завершения скрипта).</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">setmetatable(gcrunner, { __gc = function()</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if tid then DestroyTable(tid) end &nbsp;</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---- &nbsp; &nbsp;Выделенный ниже фрагмент срабатывает при запуске collectgarbage до завершения скрипта если gcrunner локальная переменная.</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-- &nbsp; &nbsp; &nbsp;При запуске функции по заверщению скрипта, выделенный фрагмент не выполняется. &nbsp;Функция завершается на первом операторе</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--- &nbsp; &nbsp;без его выполнения, но ошибка не выдается ??</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file:write(&quot;__gc\n&quot;) &nbsp;</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file:close()</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;---- Похоже при завершении скрипта файлы открепляются раньше, чем запускается финальная уборка мусора----</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> &nbsp;end })</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">--------------------------------------------------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br /><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">function OnInit(script_path)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> file = io.open(script_path .. &quot;.log&quot;, &quot;w&quot;)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> file:write(&quot;OnInit\n&quot;)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">end</span><br /><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">function main()</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> file:write(&quot;main\n&quot;)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> tid = AllocTable()</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> AddColumn(tid, 1, &#39;1&#39;, true, QTABLE_INT_TYPE, 1)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> CreateWindow(tid)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">-- collectgarbage () &nbsp;--- &nbsp;Если эту строку раскомментировать и при этом local gcrunner = {}, то при запуске collectgarbage () сработает __gc.</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> while run do sleep(300) end</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> file:write(&quot;main stopped\n&quot;)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">end</span><br /><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">function OnStop()</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> run = nil</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;"> file:write(&quot;OnStop\n&quot;)</span><br /><span class="bx-font" style="font-size:8pt; line-height: normal;">end</span><br />&lt;/code&gt; <br />
			<i>05.12.2020 12:33:40, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50781/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50781/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 12:33:40 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50780/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_Lgq2ogGe" href="/user/47/" bx-tooltip-user-id="47"><noindex><a href="mailto:s_mike@rambler.ru" target="_blank" rel="nofollow">s_mike@rambler.ru</a></noindex></a> написал:<br />вообще qlua при завершении скрипта сама закрывает файлы. &nbsp;Видимо файл был закрыт до __gc<br />=============<br />Похоже так оно и есть.<br /><br />&lt;code&gt;<br />local run = true<br />local tid = nil<br />local file<br /><br />--- &nbsp;Создание деструктора &nbsp;скрипта &nbsp;-----	<br />gcrunner = {} &nbsp; --- &nbsp;Если &nbsp; gcrunner &nbsp;= {} (глобальная переменная), то &nbsp;__gc срабатывает только по завершению скрипта (обычно это и требуется). <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --- &nbsp;!!! &nbsp;А если &nbsp;local gcrunner = {} (локальная переменная) то __gc &nbsp;срабатывает при при любом запуске collectgarbage &nbsp;(в том числе, и до завершения скрипта). <br />setmetatable(gcrunner, { __gc = function() <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if tid then DestroyTable(tid) end &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ---- &nbsp; &nbsp;Выделенный ниже фрагмент срабатывает при запуске collectgarbage до завершения скрипта если gcrunner локальная переменная. <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- &nbsp; &nbsp; &nbsp;При запуске функции по заверщению скрипта, выделенный фрагмент не выполняется. &nbsp;Функция завершается на первом операторе <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --- &nbsp; &nbsp;без его выполнения, но ошибка не выдается ??<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file:write(&quot;__gc\n&quot;) &nbsp; <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;file:close()<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ---- Похоже при завершении скрипта файлы открепляются раньше, чем запускается финальная уборка мусора----<br />										 &nbsp; end }) <br />--------------------------------------------------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br /><br />function OnInit(script_path)<br /> &nbsp;file = io.open(script_path .. &quot;.log&quot;, &quot;w&quot;)<br /> &nbsp;file:write(&quot;OnInit\n&quot;)<br />end<br /><br />function main()<br /> &nbsp;file:write(&quot;main\n&quot;)<br /> &nbsp;tid = AllocTable()<br /> &nbsp;AddColumn(tid, 1, &#39;1&#39;, true, QTABLE_INT_TYPE, 1)<br /> &nbsp;CreateWindow(tid)<br /> -- collectgarbage () &nbsp;--- &nbsp;Если эту строку раскомментировать и при этом local gcrunner = {}, то при запуске collectgarbage () сработает __gc.<br /> &nbsp;while run do sleep(300) end<br /> &nbsp;file:write(&quot;main stopped\n&quot;)<br />end<br /><br />function OnStop()<br /> &nbsp;run = nil<br /> &nbsp;file:write(&quot;OnStop\n&quot;)<br />end<br />&lt;code&gt; <br />
			<i>05.12.2020 12:18:31, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50780/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50780/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 12:18:31 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50778/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_32X9yb3M" href="/user/47/" bx-tooltip-user-id="47"><noindex><a href="mailto:s_mike@rambler.ru" target="_blank" rel="nofollow">s_mike@rambler.ru</a></noindex></a> написал:<br />но это неточно )<br />=============<br />Точно<br />
====code====
<pre>local gcrunner = (function()
&nbsp;&nbsp;local t = {}
&nbsp;&nbsp;setmetatable(t, { __gc = function()
&nbsp;&nbsp;&nbsp;&nbsp;local t = tid
&nbsp;&nbsp;&nbsp;&nbsp;tid = nil
&nbsp;&nbsp;&nbsp;&nbsp;if t then DestroyTable(t) end
&nbsp;&nbsp;&nbsp;message('file type is ' .. io.type(file))
&nbsp;&nbsp;&nbsp;file:write("__gc&#92;n")
&nbsp;&nbsp;&nbsp;file:close()
&nbsp;&nbsp;end })
&nbsp;&nbsp;return t
end)()
</pre>
============= <br />
			<i>05.12.2020 02:51:26, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50778/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50778/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 02:51:26 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50777/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Увидел.. &nbsp;от скобочек глаза заслезились ))<br /><br /><br />вообще qlua при завершении скрипта сама закрывает файлы. &nbsp;Видимо файл был закрыт до __gc<br /><br />но это неточно ) <br />
			<i>05.12.2020 00:40:28, s_mike@rambler.ru.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50777/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50777/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 00:40:28 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50776/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_FHadkkNA" href="/user/54/" bx-tooltip-user-id="54">Старатель</a> написал:<br /> <br />====quote====<br /><noindex><a href="/user/1222/" target="_blank" rel="nofollow">Anton</a></noindex> написал:<br />Это деструктор.<br />=============<br /> <br />Финализатор не хочет с файлами работать:<br /> 
====code====
<pre>&nbsp;&nbsp; local&nbsp;&nbsp;run&nbsp;&nbsp;=&nbsp;&nbsp; true 
 local&nbsp;&nbsp;tid&nbsp;&nbsp;=&nbsp;&nbsp; nil 
 local&nbsp;&nbsp;file

 local&nbsp;&nbsp;gcrunner&nbsp;&nbsp;=&nbsp;&nbsp;( function ()
&nbsp;&nbsp; local&nbsp;&nbsp;t&nbsp;&nbsp;=&nbsp;&nbsp;{}
&nbsp;&nbsp;setmetatable(t, { __gc&nbsp;&nbsp;=&nbsp;&nbsp; function ()
&nbsp;&nbsp;&nbsp;&nbsp; local&nbsp;&nbsp;t&nbsp;&nbsp;=&nbsp;&nbsp;tid
&nbsp;&nbsp;&nbsp;&nbsp;tid&nbsp;&nbsp;=&nbsp;&nbsp; nil 
&nbsp;&nbsp;&nbsp;&nbsp; if&nbsp;&nbsp;t&nbsp;&nbsp;then&nbsp;&nbsp; DestroyTable (t)&nbsp;&nbsp;end 
&nbsp;&nbsp;&nbsp;&nbsp;file:write( "__gc&#92;n" )
&nbsp;&nbsp;&nbsp;&nbsp;file:close()
&nbsp;&nbsp; end&nbsp;&nbsp;})
&nbsp;&nbsp; return&nbsp;&nbsp;t
 end )()

 function&nbsp;&nbsp; OnInit (script_path)
&nbsp;&nbsp;file&nbsp;&nbsp;=&nbsp;&nbsp; io.open (script_path&nbsp;&nbsp;..&nbsp;&nbsp; ".log" ,&nbsp;&nbsp;"w" )
&nbsp;&nbsp;file:write( "OnInit&#92;n" )
 end 

 function&nbsp;&nbsp; main ()
&nbsp;&nbsp;file:write( "main&#92;n" )
&nbsp;&nbsp;tid&nbsp;&nbsp;=&nbsp;&nbsp; AllocTable ()
&nbsp;&nbsp; AddColumn (tid,&nbsp;&nbsp;1 ,&nbsp;&nbsp;'1' ,&nbsp;&nbsp;true , QTABLE_INT_TYPE,&nbsp;&nbsp;1 )
&nbsp;&nbsp; CreateWindow (tid)
&nbsp;&nbsp; while&nbsp;&nbsp;run&nbsp;&nbsp;do&nbsp;&nbsp; sleep ( 300 )&nbsp;&nbsp;end 
&nbsp;&nbsp;file:write( "main stopped&#92;n" )
 end 

 function&nbsp;&nbsp; OnStop ()
&nbsp;&nbsp;run&nbsp;&nbsp;=&nbsp;&nbsp; nil 
&nbsp;&nbsp;file:write( "OnStop&#92;n" )
 end&nbsp;&nbsp; </pre>
=============
 <br />В логе: <br />====quote====<br />OnInit<br />main<br />OnStop<br />main stopped<br />=============<br /> <br />=============<br /><br />я может плохо смотрю, но не вижу вызова функции gcrunner <br />
			<i>05.12.2020 00:36:29, s_mike@rambler.ru.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50776/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50776/topic6021/</guid>
			<pubDate>Sat, 05 Dec 2020 00:36:29 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50775/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_jtqnJcC7" href="/user/1222/" bx-tooltip-user-id="1222">Anton</a> написал:<br />Это деструктор.<br />=============<br /><br />Финализатор не хочет с файлами работать:<br />
====code====
<pre>local run = true
local tid = nil
local file

local gcrunner = (function()
&nbsp;&nbsp;local t = {}
&nbsp;&nbsp;setmetatable(t, { __gc = function()
&nbsp;&nbsp;&nbsp;&nbsp;local t = tid
&nbsp;&nbsp;&nbsp;&nbsp;tid = nil
&nbsp;&nbsp;&nbsp;&nbsp;if t then DestroyTable(t) end
&nbsp;&nbsp;&nbsp;&nbsp;file:write("__gc&#92;n")
&nbsp;&nbsp;&nbsp;&nbsp;file:close()
&nbsp;&nbsp;end })
&nbsp;&nbsp;return t
end)()

function OnInit(script_path)
&nbsp;&nbsp;file = io.open(script_path .. ".log", "w")
&nbsp;&nbsp;file:write("OnInit&#92;n")
end

function main()
&nbsp;&nbsp;file:write("main&#92;n")
&nbsp;&nbsp;tid = AllocTable()
&nbsp;&nbsp;AddColumn(tid, 1, '1', true, QTABLE_INT_TYPE, 1)
&nbsp;&nbsp;CreateWindow(tid)
&nbsp;&nbsp;while run do sleep(300) end
&nbsp;&nbsp;file:write("main stopped&#92;n")
end

function OnStop()
&nbsp;&nbsp;run = nil
&nbsp;&nbsp;file:write("OnStop&#92;n")
end</pre>
=============
<br />В логе:<br />====quote====<br />OnInit<br />main<br />OnStop<br />main stopped<br />=============<br /> <br />
			<i>04.12.2020 23:28:59, Старатель.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50775/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50775/topic6021/</guid>
			<pubDate>Fri, 04 Dec 2020 23:28:59 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50758/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_L3KVgJZA" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br /> при нажатии кнопки &quot;добавить&quot; при загрузке скриптов он открывает не папку &quot;своего&quot; Квика, а ту, из которой была последняя загрузка.<br />=============<br />Вы правы, причина в этом, просто надо быть внимательнее при добавлении скриптов в окне... <br />
			<i>03.12.2020 18:00:58, Александр Волфовиц.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50758/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50758/topic6021/</guid>
			<pubDate>Thu, 03 Dec 2020 18:00:58 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50734/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_iRhFWkgJ" href="/user/1222/" bx-tooltip-user-id="1222">Anton</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" /> <br /><br />А ООП-религия у меня сложилась давно, ещё от Маккарти. И не всяким Страуструпам её поколебать! &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" /> &nbsp; <br />
			<i>02.12.2020 16:45:42, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50734/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50734/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 16:45:42 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50732/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_c3MInHxU" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br />И что бы это значило?<br />=============<br />Это деструктор. Допишите-попробуйте, может так и в ооп-религию перейдете. <br />
			<i>02.12.2020 15:30:03, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50732/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50732/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 15:30:03 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50730/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_feN0msIy" href="/user/1222/" bx-tooltip-user-id="1222">Anton</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" /> &nbsp; <br />
			<i>02.12.2020 15:21:08, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50730/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50730/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 15:21:08 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50727/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_5eqBbgLf" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br />а теперь там же стал ещё и убивать окно своей таблицы<br />=============<br />
====code====
<pre>local run = true
local tid = nil
local gcrunner = (function()
&nbsp;&nbsp;&nbsp;local t = {}
&nbsp;&nbsp;&nbsp;setmetatable(t, { __gc = function()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local t = tid
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tid = nil
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if t then DestroyTable(t) end
&nbsp;&nbsp;&nbsp;end })
&nbsp;&nbsp;&nbsp;return t
end)()

function main()
&nbsp;&nbsp;&nbsp;tid = AllocTable()
&nbsp;&nbsp;&nbsp;AddColumn(tid, 1, '1', true, QTABLE_INT_TYPE, 1)
&nbsp;&nbsp;&nbsp;CreateWindow(tid)
...
</pre>
============= <br />
			<i>02.12.2020 15:14:01, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50727/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50727/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 15:14:01 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50701/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_t3xYcpdr" href="/user/1222/" bx-tooltip-user-id="1222">Anton</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" /> Впрочем, фиг с ними обоими - у меня сейчас идёт финальная зачистка уже моего алгоритма - все &quot;квиковские&quot; штучки считаю отлаженными. Последняя правка была вчера: как известно, эта скотина теряет управление при остановке скрипта, поэтому файл результатов я записываю прямо в OnStop (благо запись не обращается к утилитам основного потока), а теперь там же стал ещё и убивать окно своей таблицы. Окно-то она убивает, &quot;зато&quot; влетает в режим этого дурацкого ожидания, так что теперь у меня OnStop возвращает 500, чтобы не мучился свои 5 секунд, и для юзера это (аварийное) завершение смотрится как нормальное. Комедия! <br />
			<i>02.12.2020 10:35:52, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50701/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50701/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 10:35:52 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50695/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			STRING getScriptPath()<br />Функция возвращает путь, по которому находится запускаемый скрипт, без завершающего обратного слеша («\»). Например, C:\QuikFront\Scripts <br />
			<i>02.12.2020 07:50:13, swerg.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50695/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50695/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 07:50:13 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50689/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_taZnrXhl" href="/user/14299/" bx-tooltip-user-id="14299">Владимир</a> написал:<br />при нажатии кнопки &quot;добавить&quot; при загрузке скриптов он открывает не папку &quot;своего&quot; Квика, а ту, из которой была последняя загрузка.<br />=============<br />В этом конкретном случае квики путает винда. Квик просто открывает стандартный диалог, а тот сам помнит, кто что открывал последнее. Но помнит абы как, по имени программы без полного пути, вот и получается путаница. По-хорошему надо к диалогу <noindex><a href="https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialog-setclientguid" target="_blank" rel="nofollow">прицеплять уникальный идентификатор</a></noindex>, но квик этого не делает.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_qgtpYJre" href="/user/1024/" bx-tooltip-user-id="1024">Александр Волфовиц</a> написал:<br />Как определить абсолютный путь?<br />=============<br />2.2.25 OnInit<br />Функция вызывается терминалом QUIK перед вызовом функции main(). В качестве параметра принимает значение полного пути к запускаемому скрипту. <br />
			<i>02.12.2020 01:10:21, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50689/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50689/topic6021/</guid>
			<pubDate>Wed, 02 Dec 2020 01:10:21 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50687/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			&quot;С:\Quik1&quot; , &quot;C:\Quik2&quot; и есть абсолютный путь. &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" /> У меня тоже два Квика, но путает папки вовсе не Lua (там у меня как раз относительный путь типа F=io.open(getScriptPath()..&quot;//datafile.txt&quot;,&quot;r&quot;), а сам Квик: при нажатии кнопки &quot;добавить&quot; при загрузке скриптов он открывает не папку &quot;своего&quot; Квика, а ту, из которой была последняя загрузка. <br />
			<i>01.12.2020 21:07:08, Владимир.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50687/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50687/topic6021/</guid>
			<pubDate>Tue, 01 Dec 2020 21:07:08 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Как определить абсолютный путь к исполняемому файлу lua?</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message50686/topic6021/">Как определить абсолютный путь к исполняемому файлу lua?</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Использовал относительный путь, но имеется несколько папок с квиками от разных брокеров и мой фреймворк почему-то &quot;путает&quot; папки (папки типа &quot;С:\Quik1&quot; , &quot;C:\Quik2&quot; , и т.д.). Поэтому решил использовать абсолютный путь для исключения ошибок. Как определить абсолютный путь? <br />
			<i>01.12.2020 20:47:57, Александр Волфовиц.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message50686/topic6021/</link>
			<guid>http://forum.quik.ru/messages/forum10/message50686/topic6021/</guid>
			<pubDate>Tue, 01 Dec 2020 20:47:57 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
