<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[TuxFamily's forum — LUA et FPC/Lazarus]]></title>
		<link>/topic/35/lua-et-fpclazarus/</link>
		<atom:link href="https://forum.tuxfamily.org/feed/rss/topic/35/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in LUA et FPC/Lazarus.]]></description>
		<lastBuildDate>Fri, 16 Mar 2007 21:19:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: LUA et FPC/Lazarus]]></title>
			<link>/post/362/#p362</link>
			<description><![CDATA[<p>salut</p><p>Ben non. Ni là.</p>]]></description>
			<author><![CDATA[null@example.com (fvpat)]]></author>
			<pubDate>Fri, 16 Mar 2007 21:19:03 +0000</pubDate>
			<guid>/post/362/#p362</guid>
		</item>
		<item>
			<title><![CDATA[Re: LUA et FPC/Lazarus]]></title>
			<link>/post/343/#p343</link>
			<description><![CDATA[<p>Tu n&#039;as pas d&#039;aide ici non plus !!!</p>]]></description>
			<author><![CDATA[null@example.com (wile64)]]></author>
			<pubDate>Fri, 16 Mar 2007 15:14:53 +0000</pubDate>
			<guid>/post/343/#p343</guid>
		</item>
		<item>
			<title><![CDATA[Re: LUA et FPC/Lazarus]]></title>
			<link>/post/331/#p331</link>
			<description><![CDATA[<p>Ben apparemment, y a pas beaucoup de monde qui aurait déjà fait ça :(</p><p>Bon voici un bout de code pour ceux que ça intéresserait (le très populaire &quot;Hello world&quot;). Je suis parti de <a href="http://www.eonclash.com/ViewProduct.php?ProductID=21">ça</a>.</p><p>unit1.pas<br /></p><div class="codebox"><pre><code>unit main;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
  StdCtrls, lua, luautils, luawrapper;
type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end; 

var
  Form1: TForm1; 

implementation

{ TForm1 }

function luaHello(state: Plua_state): Integer; cdecl;
begin
  showmessage(&#039;hello world&#039;);
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  LuaScript: TLUA;
begin
  LuaScript := TLUA.Create(nil);
  LuaScript.LoadFile(&#039;hello.lua&#039;);
  LuaScript.RegisterLUAMethod(&#039;Hello&#039;, @luaHello);
  LuaScript.Execute;
  LuaScript.Free;
end;

initialization
  {$I main.lrs}

end.</code></pre></div><p>Un script LUA<br /></p><div class="codebox"><pre><code>Hello &quot;&quot;</code></pre></div><p>Résultat de tout ça : lorsqu&#039;on clique sur Button1, une fenêtre s&#039;ouvre et affiche le message &quot;Hello world&quot;.</p><p>Comment ça marche ? Une fois la fonction Hello (script lua) déclarée dans FPC, on l&#039;associe à la fonction luaHello (FPC). Pour finir on lance le script LUA.</p>]]></description>
			<author><![CDATA[null@example.com (fvpat)]]></author>
			<pubDate>Wed, 14 Mar 2007 15:29:10 +0000</pubDate>
			<guid>/post/331/#p331</guid>
		</item>
		<item>
			<title><![CDATA[LUA et FPC/Lazarus]]></title>
			<link>/post/187/#p187</link>
			<description><![CDATA[<p>Bonjour,</p><p>Pour mon projet (<a href="http://fvpatwds.tuxfamily.org/">fvpatwds</a>), je souhaiterais intégré un langage de script (LUA) qui permettrait aux utilisateurs d&#039;ajouter des plugins qu&#039;ils auraient eux-même développés.<br />Le problème, c&#039;est que je ne maîtrise pas suffisamment LUA. Quelqu&#039;un aurait-il déjà intégré LUA dans un programme FreePascal ?<br />Je suis preneur de toute information qui pourrait m&#039;aider.</p><p>Merci à tous.</p>]]></description>
			<author><![CDATA[null@example.com (fvpat)]]></author>
			<pubDate>Thu, 11 Jan 2007 15:12:00 +0000</pubDate>
			<guid>/post/187/#p187</guid>
		</item>
	</channel>
</rss>
