This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 Action Scripts Using Alien
 Environment Variables
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

plunt

Italy
88 Posts

Posted - 12/30/2012 :  06:39:41  Show Profile
I use this simple function to get system variables as TMP or ProgramFiles.
It would be useful to implement it directly in the program?

function Env(var)
	local eev = kernel32.ExpandEnvironmentStringsA
	eev:types{ ret = "long", abi = 'stdcall', "string", "pointer", "long" }
	local buffer = aliencore.buffer(512)
	eev("%" .. var .. "%", buffer, 512)
	return tostring(buffer)
end

Rob

USA
2615 Posts

Posted - 12/30/2012 :  16:23:34  Show Profile  Visit Rob's Homepage
Actually I think it will be good to provide folks with a .lua file which includes a bunch of functions that people have come up with. The reason I built Alien and Lua into S+ was so people could add functionality without needing a new version to be released.

There's really no reason to build this into S+ as it works fine here. If eev was defined in Global Lua (instead of being instantiated for each call to Env), it's not really much different than if it were built-in.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000