Previous Chapter Portal: http://www.jb51.net/article/55088.htm
In this chapter we'll learn a little demo, the scene from the previous chapter: C + + Gets a string of global variables from LUA.
1. Introduction of header Files
Let's take a look at what we need to use LUA in C + +.
Copy Code code as follows:
Nginx + lua + redis implement verification code anti-collection
I have introduced how to embed the lua module in nginx. Using nginx + lua can develop nginx business logic well and achieve high concurrency.
The following describes how to use nginx + lua + redis to implement t
Running Environment
Win7 64
Cocos2d-2.1rc0-x-2.1.2
Lua 5.1
Generally, the written lua code is in plain text format. Anyone can view the modifications. To prevent the fruits of their work from being easily stolen by others, you can use luac (automatically included in the lua database) encrypt it and convert it to a bi
There are two functions in the Lua file, then call the code with the CPP file, finally, there is a critical step, compile, we need to add additional options: g++ main.cpp-o main-llua-ldl. The process looks simple and requires hands-on operation.
First you install the Lua dev, which is simple to install:
Yum Install Lua
Turn from: http://blog.csdn.net/wtyqm/article/details/9346863
Enjoy the benefits of scripting language flexibility, ease of updating, and freedom from compilation, but you can't tolerate leaving those handy IDE features (jump, AutoComplete).
Collection and collation of some use sublime text editing Cocos2dx-lua project information, hope to bring help to everyone.
One, automatic completion (auto-completion)
A. The words that have been entered
The word
Operating EnvironmentWin7 64cocos2d-2.1rc0-x-2.1.2LUA 5.1Usually we write good LUA code is clear form, anyone can see the changes, in order to prevent their labor results are not easily stolen by others, you can use LUAC (LUA library) to encrypt it, converted to binary files. This will not allow the LUA
Set_form_input method, and successfully returns the result to the foreground.Now, we need to process the data on the post, so we pass data as a parameter to the LUA code, process it through the LUA code, and we need to return the result to Nginx.Here, change the configuration of the nginx.conf 26~29 line:1 location/Sa
Original visualfc
The wtl Application Wizard (LUA) is compiled using iuplua. This article briefly describes its source code and analyzes the multilingual interface processing mechanism of the wizard.
The source code of the wtl Application Wizard can be downloaded from http://code.google.com/p/visualfc/downloads/list. The following is a brief description.
I. Deve
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Open the Lua integrated development environment of SciTE and edit the Lua01.lua file as follows (this program places this file in the D: \ LuaTestDoc \ path, when the
1. OverviewThere are two userdata in Lua, one is the lightweight userdata (light UserData), and the lightweight userdata is a value that represents the C pointer, which does not require GC (garbage collection) for LUA virtual machines, and the memory it points to is allocated and freed by the user , the implementation is a void *p pointer, the latter UserData type is fully UserData (full UserData), the memo
OverviewInLuain a8type of Base:Nil,Boolean, Number,string,UserData,function,Threadand theTable. You can use functionstypelook at the type of a variable or value, and return the appropriate type name. Like other dynamic languages, there is no type-defined syntax in the language, and each value carries its own type information. The following will be passedLua 5.2.1 of the source code to see the type of implementation.Source
Overview
LUA is fully 8-bit encoded, and the characters in the LUA string can have any numeric encoding, including a value of 0. That is, any binary data can be stored in a string. The LUA string is immutable (immutable values). If you modify it, you are essentially creating a new string. In Lua, strings are the objec
Detailed description of the assignment type code in lua
This article mainly introduces the process of parsing and copying type code in lua, which is very detailed and comprehensive. If you need it, you can refer
Let's take a look at the entire process of lua vm parsing the f
This program reads the content from the terminal and then runs according to the Lua block. # Include Compilation error: Lua. H: No file or directoryLocate Lua. h does not have the corresponding header file under the corresponding include directory. You need to download and install liblua5.2-Dev, and then sudo updatedb; locate
By using the CL compiler under VC, it is easy to compile the LUA source code without having to construct the project and set up various options;Following the source Lua5.3.1 version for example, will be compiled directly through the CL source code, for easy compilation will use batch script, script placed in the directory after
This example downloads1.c# interaction with Lua Please refer to my previous article Lua combined C # to invoke C + + or C functions2. In C #, how to put a piece of code fragments in the main thread execution. For WinForm Programs:
public void Executemethodinmainthread ()
{
if (this. InvokeRequired)
{this
. Invoke (N
It can be said that Lua is called an interpreted language because there are functions such as load, because such a function allows Lua to execute dynamically generated code. The following is a detailed analysis of these functions.
Load function
The Load function prototype is as follows:
Copy Code
1. The discovery of Lua is a "shallow copy", with no address, reference, or deep copy, which makes it difficult for some sophisticated designs.
2. Lua variables have no type pairing, but the system that calls Lua has type pairing, which contradicts the cost of interactive design.
3. In order for the code to be highly m
Lua does not have a debugger, but it provides strong debugging functions (debug library). In fact, some common debugging functions can be used conveniently, just like using a command line Debugger:
[Example]Program]
-- Debug. LuaGvar1 = 100 function Foo () Local var2 = 10 function bar () Debug. debug () return var2 end bar () enddebug. debug () Foo ()
Set breakpoints]
This is a little more troublesome and needs to be modified.CodeAdd the fo
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.