PDA

View Full Version : SessionVar Action Plugin



ShadowUK
03-20-2009, 12:47 PM
http://imgkk.com/images/enk3jgvq.png

This plugin is identical to the Setup Factory version. However, I have added SessionVar.GetAll, This is also written in pure Lua.

(Function help guide.) (http://www.indigorose.com/webhelp/suf80/Program_Reference/Actions/Alphabetical_List.htm#Sessionvar)

This may prove to be useful for a program where you might integrate a plugin system or something like that.

This is a type 2 plugin.


SessionVar Action Plugin


_at_SessionVar.xml

Install Path: Program Files/AutoPlay Media Studio 7.5/Data/Actions/
Description: This file defines the actions to use in the Script Editor.


Example.apz

Description: This file is an example for using the SessionVar Action Plugin.


Globals.lua

Install Path: Program Files/AutoPlay Media Studio 7.5/Data/Includes/_notification_message.lua
Notes: Copy all the contents of this file and put them at the bottom of _notification_messages.lua.
Description: This file defines the Lua code.



Everything can be found here (http://indigorose.com/forums/attachment.php?attachmentid=7926&d=1237571154).

reteset
03-26-2009, 01:51 PM
nice work and very useful :yes

one thing :

your implemention is different than you referenced



Tip: You can tell when a session variable is undefined if the string returned is the same as the string passed in.


if variable is undefined; your function returns nil instead of passed string


function SessionVar.Get(Variable)
assert(type(Variable) == "string", "Variable is not type string.");
return SessionVar.Stored[Variable] or nil;
end

but nil beter than passed string for me
thanks for sharing it

shadiku
03-28-2009, 11:18 AM
nice work and very useful :yes

one thing :

your implemention is different than you referenced



if variable is undefined; your function returns nil instead of passed string


function SessionVar.Get(Variable)
assert(type(Variable) == "string", "Variable is not type string.");
return SessionVar.Stored[Variable] or nil;
end

but nil beter than passed string for me
thanks for sharing it


function SessionVar.Get(Variable)
assert(type(Variable) == "string", "Variable is not type string.");
return SessionVar.Stored[Variable] or Variable;
end

If you want it to return the passed string instead.

rexzooly
11-09-2009, 12:44 PM
Seems i missed this thanks bud:yes