Mark Edgar

lua-users home
wiki

mailto:medgar123+lua@gmail.com
a Lua module for Kepler/IIS which simply calls RevertToSelf?(). This is useful for authenticating users and performing tasks on their behalf under a system account. Note you'll need the following:

obtain description of Windows API error messages.

a version of SlightlyLessSimpleLuaPreprocessor for use with [CGILua]
my cgilua/config.lua file containing a loader for "slslpp pages"

a Windows Registry API

an API for platform-independent file system and process management

math.classify and math.copysign

crypto.rand module for luacrypto -- this is now included in the standard distribution as of version 0.2.0

Here are some miscellanenous functions for LuaInterface:

luanet.array creates and initializes .NET arrays from Lua tables
--Correction: Use
array:SetValue(init[i], i-1)
--instead of 
array[i - 1] = init[i]
luanet.elements returns a Lua interator given a .NET object which implements IEnumerable

The luanet/using.lua module implements both a C#-style using directive and a C#-style using statement. Here is an example incorporating both the directive and the statement forms:

require "luanet.using"('System', 'System.IO')

local filename = "sample.txt"

luanet.using(File:CreateText(filename), function(w)
	w:WriteLine("This is line one")
	w:WriteLine("This is line two")
end)

luanet.using(File:OpenText(filename), function(r)
	local s = r:ReadLine()
	while s do
		Console:WriteLine(s)
		s = r:ReadLine()
	end
end)

The using directive allows a lua program to look up .NET classes from the global environment. The "using directive" can be used in a variety of styles:

require "luanet.using"(System, System.IO)

local using = require "luanet.using"
using(System, System.IO)

local using = require "luanet.using"
using 'System';
using 'System.IO';

require "luanet.using" 'System' 'System.IO'

-- Write to me here medgar student gc maricopa edu.

I can also be found online irc://irc.freenode.net/#lua


RecentChanges · preferences
edit · history
Last edited May 31, 2010 1:05 pm GMT (diff)