<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh">
	<id>https://calcwiki.org/index.php?action=history&amp;feed=atom&amp;title=TI-Lua%2F%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE</id>
	<title>TI-Lua/加载外部数据 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://calcwiki.org/index.php?action=history&amp;feed=atom&amp;title=TI-Lua%2F%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE"/>
	<link rel="alternate" type="text/html" href="https://calcwiki.org/index.php?title=TI-Lua/%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE&amp;action=history"/>
	<updated>2026-05-04T02:26:46Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://calcwiki.org/index.php?title=TI-Lua/%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE&amp;diff=8301&amp;oldid=prev</id>
		<title>Dousha99：​添加导航栏</title>
		<link rel="alternate" type="text/html" href="https://calcwiki.org/index.php?title=TI-Lua/%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE&amp;diff=8301&amp;oldid=prev"/>
		<updated>2017-02-11T14:04:14Z</updated>

		<summary type="html">&lt;p&gt;添加导航栏&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2017年2月11日 (六) 14:04的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l40&quot;&gt;第40行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第40行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;当 loader.tns 运行时，将会加载 MyLib/externdat.tns 返回的内容并显示在屏幕左上角处。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;当 loader.tns 运行时，将会加载 MyLib/externdat.tns 返回的内容并显示在屏幕左上角处。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{TI-Lua}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key calcwiki-cw_:diff:1.41:old-7875:rev-8301:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Dousha99</name></author>
	</entry>
	<entry>
		<id>https://calcwiki.org/index.php?title=TI-Lua/%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE&amp;diff=7875&amp;oldid=prev</id>
		<title>Dousha99：​初始化该页面</title>
		<link rel="alternate" type="text/html" href="https://calcwiki.org/index.php?title=TI-Lua/%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE&amp;diff=7875&amp;oldid=prev"/>
		<updated>2016-07-07T07:41:10Z</updated>

		<summary type="html">&lt;p&gt;初始化该页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;尽管[[德州仪器|德仪]]在 [[TI-Nspire系列]]机型上限制了文件访问，我们依然可以通过 TI-Lua 加载外部数据。&lt;br /&gt;
&lt;br /&gt;
请注意，由于 TI-Nspire 的[[TI-Nspire数学后端|数学后端]]没有写入文件的功能，因此此方法仅能用于&amp;#039;&amp;#039;&amp;#039;读&amp;#039;&amp;#039;&amp;#039;文件，而不能写出文件。&lt;br /&gt;
&lt;br /&gt;
== 原理 ==&lt;br /&gt;
&lt;br /&gt;
通过调用数学后端加载 MyLib 中的表达式，以获取对应数据。&lt;br /&gt;
&lt;br /&gt;
== 范例 ==&lt;br /&gt;
&lt;br /&gt;
此文件命名为 externdat.tns, 其中包含函数如下代码所示&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=basic&amp;gt;&lt;br /&gt;
Define LibPub loadme()=&lt;br /&gt;
Func&lt;br /&gt;
    Return &amp;quot;External data!&amp;quot;&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
将此文件放入 MyLib 文件夹，并&amp;#039;&amp;#039;&amp;#039;刷新库&amp;#039;&amp;#039;&amp;#039;。&lt;br /&gt;
&lt;br /&gt;
此文件命名为 loader.tns, 其中包含 Lua 程序如下所示&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=lua&amp;gt;&lt;br /&gt;
function load()&lt;br /&gt;
    return math.evalStr(&amp;quot;externdat\\loadme()&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function on.paint(gc)&lt;br /&gt;
    local result = load()&lt;br /&gt;
    if result == nil then&lt;br /&gt;
        gc:drawString(0, 0, &amp;quot;Cannot load data&amp;quot;, &amp;quot;top&amp;quot;)&lt;br /&gt;
    else&lt;br /&gt;
        gc:drawString(0, 0, result, &amp;quot;top&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
platform.window:invalidate()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
当 loader.tns 运行时，将会加载 MyLib/externdat.tns 返回的内容并显示在屏幕左上角处。&lt;/div&gt;</summary>
		<author><name>Dousha99</name></author>
	</entry>
</feed>