I use protocol buffers for data serialization in my C application. I want to add a call to the protoc code generator in my premake build script (to ensure that the generated class The latest state,
Tag: lua
Lua saves the string to the file
I started to use Lua to go to school, I want to know if it is possible to save the string to a txt file?
That is
I have a string called shroom, which is equal to mushy.
I am in th
Lua gets the file name according to the path
require “lfs”
function dirpath(path)
for file in lfs.dir(path) < span style="color: #0000ff;">do — lfs.dir according to Path to get the file name under the path
if file ~= ‘.’ and file ~= ‘
LUA variable lookup and global variable
1. Speaking of hello world When the print(“Hello World!”) is executed, it is obvious that a specific function of printing a string to the standard output is required. So the first thing involved he
How to pass the lua function to the C function and perform Lua functions multiple times?
What I want to do is create a function that will iterate some objects and call a function for each function. I am using BlitzMax, not C, but other than that , Because it has a complete Lua C functi
Lua String.upper does not use stress characters?
I am trying to convert some French text to uppercase letters in lua, it will not convert accented characters. Do you know why?
Test script:
print(‘échelle’)
print(string.upper(‘échelle
Rawset function in Lua
The rawset function in Lua is generally to pass the table, index and value, but I encountered this code:
rawset(tbl,name,()) and
rawset(tbl,name, function() end) Rawset The function ret
Find a random number in Lua
I tried to use lua to generate a random number, but it just spit out the lowest value. For example, if I run:
x = math.random(17,41)
print(x) It returns:
17 what happened?
You c
How do I check if a matching text is found in the string in Lua?
If at least one specific matching text is found in the text string, I need to make the condition true, for example:
str = “This is some text containing the word tiger.”
if string.match(str, “
How to call a function in C DLL from Lua?
I have a DLL written in C. It is legacy code and the source code cannot be modified. I want to be able to call some functions inside the DLL from Lua.
— My Lua File
include(myCppDll.dll)
fun