<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: Можно объяснить, почему данный код не работает]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме Можно объяснить, почему данный код не работает форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Sun, 26 Apr 2026 09:37:53 +0300</pubDate>
		<item>
			<title>Можно объяснить, почему данный код не работает</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message45965/topic5530/">Можно объяснить, почему данный код не работает</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<noindex><a href="https://www.lua.org/manual/5.3/manual.html#lua_tolstring" target="_blank" rel="nofollow">https://www.lua.org/manual/5.3/manual.html#lua_tolstring</a></noindex><br /><br />If the value is a number, then lua_tolstring also <I>changes the actual value in the stack to a string</I>. (This change confuses <noindex><a href="https://www.lua.org/manual/5.3/manual.html#lua_next" target="_blank" rel="nofollow">lua_next</a></noindex> when lua_tolstring is applied to keys during a table traversal.) <br />
			<i>04.06.2020 20:48:07, Anton.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message45965/topic5530/</link>
			<guid>http://forum.quik.ru/messages/forum10/message45965/topic5530/</guid>
			<pubDate>Thu, 04 Jun 2020 20:48:07 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Можно объяснить, почему данный код не работает</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message45963/topic5530/">Можно объяснить, почему данный код не работает</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Вот код:
====code====
<pre>&nbsp;&nbsp;lua_newtable(LuaState);
&nbsp;&nbsp;lua_pushinteger(LuaState, 1); 
&nbsp;&nbsp;lua_pushstring(LuaState, PAnsiChar('value1')); 
&nbsp;&nbsp;lua_settable(LuaState, -3); 
&nbsp;&nbsp;lua_pushinteger(LuaState, 2); 
&nbsp;&nbsp;lua_pushstring(LuaState, PAnsiChar('value2'));
&nbsp;&nbsp;lua_settable(LuaState, -3);
&nbsp;&nbsp;lua_pushnil(LuaState);
&nbsp;&nbsp;while (lua_next(LuaState, -2) &#60;&#62; 0) do begin
&nbsp;&nbsp;&nbsp;&nbsp;key := lua_tostring(LuaState, -2);
&nbsp;&nbsp;&nbsp;&nbsp;lua_pop(LuaState, 1);
&nbsp;&nbsp;end;
</pre>
=============
Проходит 1 итерацию и при следующем вызове lua_next выдает ошибку invalid key to &#39;next&#39;<br />если вместь lua_tostring сделать lua_tointeger - работает. <br />
			<i>04.06.2020 20:44:14, Александр.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message45963/topic5530/</link>
			<guid>http://forum.quik.ru/messages/forum10/message45963/topic5530/</guid>
			<pubDate>Thu, 04 Jun 2020 20:44:14 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
