dennis1000 / verysimplelua Goto Github PK
View Code? Open in Web Editor NEWVerySimple.Lua - Lua 5.3 for Delphi
License: Mozilla Public License 2.0
VerySimple.Lua - Lua 5.3 for Delphi
License: Mozilla Public License 2.0
Is it possible to supress a command shell poping up, when using something like io.popen in the lua script ?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
lua code
test = TTest.new();
test.dosomething();
print(test.somevalue);
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hello,
thanks for your very nice units.
I adapted them to work with Delphi XE2. The only modifications required are:
substitute $ENDIF with $IFEND in the conditional compilation beginning with $IF defined(...)
insert this conditional block in VerySimple.Lua.Lib in Interface types part:
// Compile for Delphi <= XE2
{$IF CompilerVersion<=23}
MarshaledAString = PAnsiChar;
PMarshaledAString = ^PAnsiChar;
TMarshString = record
s: string;
function ToPointer(): PAnsiChar;
end;
TMarshaller = record
s: string;
function AsAnsi(s: string): TMarshString;
end;
{$ifend}
insert this conditional block in VerySimple.Lua.Lib under Implementation part:
// Compile for Delphi <= XE2
{$IF CompilerVersion<=23}
function TMarshString.ToPointer(): PAnsiChar;
begin
Result:=PAnsiChar(AnsiString(s));
end;
function TMarshaller.AsAnsi(s: string): TMarshString;
var
ms: TMarshString;
begin
ms.s:= s;
Result:= ms;
end;
{$ifend}
Of course it emulates types MarshaledAString and TMarshaller that are present only in newer versions of Delphi.
Regards
Giandomenico De Sanctis
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The function reads as such:
procedure luaL_testudata(L: lua_State; ud: Integer; const tname: MarshaledAString);
However the lua 5.3 documentation declares it with a return type of void *
. I suggest this change:
function luaL_testudata(L: lua_State; ud: Integer; const tname: MarshaledAString): Integer;
Thanks for your great work in translating the C headers, it helped me tremendously.
api returns a pointer to lua_Number, not a value
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Hello! It isn't an issue, but rather a request for a code example.
I would like to call a Lua function from my Delphi program, and get the result,
as you can see in the attached example. What would my code look like, if I
would use VerySimple.Lua?
Best regards.
Roland Chastain
Original issue reported on code.google.com by [email protected]
on 21 Feb 2015 at 6:12
Attachments:
lua code
test = TTest.new();
test.dosomething();
how code the TTest in delphi?
delphi code
function TTest.new(L:lua_State):Integer;
var
obj:TTest;
begin
obj:=TTest.Create;
lua_pushobject(L,obj);
return 1;
end;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.